[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
|
// Correct mime type
|
||||||
if (request.MimeType == "image" && ident.Metadata.DecodedImageFormat?.DefaultMimeType != null)
|
if (request.MimeType == "image" && ident.Metadata.DecodedImageFormat?.DefaultMimeType != null)
|
||||||
request.MimeType = ident.Metadata.DecodedImageFormat.DefaultMimeType;
|
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)
|
if (_config.CurrentValue.MediaProcessing.ImageProcessor == Enums.ImageProcessor.None)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +103,7 @@ public class ImageProcessor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't generate thumb/webp for animated images
|
// Don't generate thumb/webp for animated images
|
||||||
if (ident.FrameMetadataCollection.Count != 0)
|
if (ident.FrameMetadataCollection.Count != 0 || pngMetadata?.AnimateRootFrame == true)
|
||||||
{
|
{
|
||||||
genThumb = false;
|
genThumb = false;
|
||||||
genWebp = false;
|
genWebp = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue