This commit is contained in:
2026-06-01 08:30:50 +02:00
parent 064bd51c64
commit bb6322e187

View File

@@ -380,8 +380,18 @@ export default new class queue {
} catch (e) { break; }
}
}
else if (mime.startsWith('image/') && mime != 'image/gif')
else if (mime.startsWith('image/') && mime != 'image/gif') {
if (mime === 'image/avif') {
try {
await this.spawn('ffmpeg', ['-i', sourcePath, '-frames:v', '1', '-update', '1', tmpFile]);
} catch (err) {
// If ffmpeg fails, fallback to magick
await this.spawn('magick', [sourcePath + '[0]', '-auto-orient', tmpFile]);
}
} else {
await this.spawn('magick', [sourcePath + '[0]', '-auto-orient', tmpFile]);
}
}
else if (mime.startsWith('audio/')) {
let coverExtracted = false;
this._lastCoverExtracted = false; // Reset state for this call