Fix GIF background server crash

This commit is contained in:
SillyLossy
2023-04-17 22:33:30 +03:00
parent 9f8aa78d8b
commit a71190aa5f
2 changed files with 4 additions and 3 deletions

View File

@@ -2013,9 +2013,10 @@ async function generateThumbnail(type, file) {
try {
const image = await jimp.read(pathToOriginalFile);
await image.cover(mySize[0], mySize[1]).quality(95).writeAsync(pathToCachedFile);
const buffer = await image.cover(mySize[0], mySize[1]).quality(95).getBufferAsync(mime.lookup('jpg'));
fs.writeFileSync(pathToCachedFile, buffer);
}
catch {
catch (err) {
return null;
}