create webp variant
This commit is contained in:
parent
32c9db5c12
commit
cb820c47cd
@ -42,7 +42,7 @@ export async function processImage(
|
||||
thumb,
|
||||
thumb.length,
|
||||
{
|
||||
"Content-Type": "image/jpeg",
|
||||
"Content-Type": mime,
|
||||
"x-amz-meta-processed": "true",
|
||||
}
|
||||
);
|
||||
@ -54,7 +54,19 @@ export async function processImage(
|
||||
optimized,
|
||||
optimized.length,
|
||||
{
|
||||
"Content-Type": "image/jpeg",
|
||||
"Content-Type": mime,
|
||||
"x-amz-meta-processed": "true",
|
||||
}
|
||||
);
|
||||
|
||||
const webp = await sharp(buffer).webp({ quality: 80 }).toBuffer();
|
||||
await minio.putObject(
|
||||
bucket,
|
||||
`${filePath}/webp/${fileName?.replace(/\.[^/.]+$/, ".webp")}`,
|
||||
webp,
|
||||
webp.length,
|
||||
{
|
||||
"Content-Type": "image/webp",
|
||||
"x-amz-meta-processed": "true",
|
||||
}
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user