From 7a4d5b79517f28dab668090bc4a540aa7aa75f5f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 31 Oct 2014 00:57:24 -0400 Subject: 3.0.5416.0 --- MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs') diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs index 1ae990775..c8e923b12 100644 --- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs +++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs @@ -213,7 +213,7 @@ namespace MediaBrowser.Server.Implementations.Drawing var newHeight = Convert.ToInt32(newSize.Height); var selectedOutputFormat = options.OutputFormat == ImageOutputFormat.Webp && !_webpAvailable - ? ImageOutputFormat.Png + ? GetFallbackImageFormat(originalImagePath) : options.OutputFormat; // Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here @@ -279,6 +279,11 @@ namespace MediaBrowser.Server.Implementations.Drawing } } + private ImageOutputFormat GetFallbackImageFormat(string originalImagePath) + { + return ImageOutputFormat.Png; + } + private void SaveToWebP(Bitmap thumbnail, Stream toStream, int quality) { new SimpleEncoder().Encode(thumbnail, toStream, quality); -- cgit v1.2.3