diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs | 7 |
1 files changed, 6 insertions, 1 deletions
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); |
