aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-31 00:57:24 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-31 00:57:24 -0400
commit7a4d5b79517f28dab668090bc4a540aa7aa75f5f (patch)
tree61141cb89479be98be1c12ffa6558565045eee70 /MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
parenta32fd710a9016b0a90166046eac53a4d582929b1 (diff)
3.0.5416.0
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs7
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);