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

@@ -1258,7 +1258,7 @@
<input id="play_message_sound" type="checkbox" />
<audio id="audio_message_sound" src="sounds/message.mp3" hidden></audio>
<span>
New Message Sound
Message Sound
<a href="/notes/message_sound" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
</a>

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;
}