fix: thumbnail content-type, animated GIF preservation, and janitor cleanup
- Add extension-based mimetype fallback in uploads route so thumbnail files serve correct Content-Type (image/webp) instead of falling back to application/octet-stream when DB lookup misses - Skip animated images (metadata.pages > 1) during thumbnail generation to preserve GIF/WebP animations instead of flattening to static frame - Remove redundant explicit thumbnail deletion in storageJanitor since deleteUploadFile() already auto-deletes the thumbnail variant
This commit is contained in:
@@ -49,6 +49,11 @@ export async function generateThumbnail(
|
||||
return null;
|
||||
}
|
||||
|
||||
// Skip animated images — Sharp would flatten to a single static frame
|
||||
if (metadata.pages && metadata.pages > 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const originalFilename = path.basename(originalPath);
|
||||
const thumbName = thumbFilename(originalFilename);
|
||||
const thumbPath = path.join(uploadDir, thumbName);
|
||||
|
||||
Reference in New Issue
Block a user