fix: #14033, fix gif profile images

add test
This commit is contained in:
Barış Soner Uşaklı
2026-03-01 19:48:53 -05:00
parent dcc4670749
commit 06bf2abfc4
4 changed files with 33 additions and 8 deletions

View File

@@ -40,13 +40,14 @@ image.resizeImage = async function (data) {
width: data.width,
height: data.height,
quality: data.quality,
type: data.type,
});
} else {
const sharp = requireSharp();
const buffer = await fs.promises.readFile(data.path);
const sharpImage = sharp(buffer, {
failOnError: true,
animated: data.path.endsWith('gif'),
animated: data.type === 'image/gif',
});
const metadata = await sharpImage.metadata();