aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-01-03 12:23:55 -0700
committerCody Robibero <cody@robibe.ro>2022-01-03 12:23:55 -0700
commit6d299eed495549fd92402571577d732c74a73b37 (patch)
tree8464bf2cd47b3e31134b866e9a4008ae22535e86 /Emby.Drawing/ImageProcessor.cs
parent37061e5b6b3116ef46ca2cd9362ba9c11c76b6a7 (diff)
Don't transform gif
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index b530c6942..18b413964 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Net.Mime;
using System.Text;
using System.Threading.Tasks;
using Jellyfin.Data.Entities;
@@ -129,17 +130,19 @@ namespace Emby.Drawing
originalImageSize = new ImageDimensions(originalImage.Width, originalImage.Height);
}
+ var mimeType = MimeTypes.GetMimeType(originalImagePath);
if (!_imageEncoder.SupportsImageEncoding)
{
- return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
+ return (originalImagePath, mimeType, dateModified);
}
var supportedImageInfo = await GetSupportedImage(originalImagePath, dateModified).ConfigureAwait(false);
originalImagePath = supportedImageInfo.Path;
- if (!File.Exists(originalImagePath))
+ // Original file doesn't exist, or original file is gif.
+ if (!File.Exists(originalImagePath) || string.Equals(mimeType, MediaTypeNames.Image.Gif, StringComparison.OrdinalIgnoreCase))
{
- return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
+ return (originalImagePath, mimeType, dateModified);
}
dateModified = supportedImageInfo.DateModified;