feat: convert all to jpg

This commit is contained in:
2023-11-13 02:53:21 +01:00
parent 355c195c27
commit 72a60f1da5
6 changed files with 623 additions and 10 deletions

View File

@ -43,10 +43,7 @@ for (const obj of objects) {
// Use Jimp to compress and convert the PNG to JPG
const image = await Jimp.read(`http://s3-api.app.max-richter.dev/silvester23/${pngFilePath}`);
// const image = await sharp(pngBuffer)
// .jpeg({ mozjpeg: true })
// .toBuffer()
const jpgBuffer = await image.quality(80).getBufferAsync(Jimp.MIME_JPEG);
const jpgBuffer = await image.quality(80).getBufferAsync(Jimp.MIME_JPEG);
// Upload the JPG buffer back to the same MinIO bucket
await minioClient.putObject(minioBucketName, jpgFilePath, jpgBuffer, {