[backend/drive] Correctly process animated PNG images
This commit is contained in:
parent
c011253d67
commit
c0835d0cc7
1 changed files with 3 additions and 1 deletions
|
@ -93,6 +93,8 @@ public class ImageProcessor
|
|||
// Correct mime type
|
||||
if (request.MimeType == "image" && ident.Metadata.DecodedImageFormat?.DefaultMimeType != null)
|
||||
request.MimeType = ident.Metadata.DecodedImageFormat.DefaultMimeType;
|
||||
if (ident.Metadata.TryGetPngMetadata(out var pngMetadata) && pngMetadata.AnimateRootFrame)
|
||||
request.MimeType = "image/apng";
|
||||
|
||||
if (_config.CurrentValue.MediaProcessing.ImageProcessor == Enums.ImageProcessor.None)
|
||||
{
|
||||
|
@ -101,7 +103,7 @@ public class ImageProcessor
|
|||
}
|
||||
|
||||
// Don't generate thumb/webp for animated images
|
||||
if (ident.FrameMetadataCollection.Count != 0)
|
||||
if (ident.FrameMetadataCollection.Count != 0 || pngMetadata?.AnimateRootFrame == true)
|
||||
{
|
||||
genThumb = false;
|
||||
genWebp = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue