reduce image processing

This commit is contained in:
Luke Pulverenti
2015-11-09 13:18:37 -05:00
parent 7d7f9d7654
commit 81bb469fe1
14 changed files with 139 additions and 443 deletions

View File

@@ -89,7 +89,7 @@ namespace Emby.Drawing.GDI
}
}
public void EncodeImage(string inputPath, string cacheFilePath, int width, int height, int quality, ImageProcessingOptions options)
public void EncodeImage(string inputPath, string cacheFilePath, int width, int height, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat)
{
var hasPostProcessing = !string.IsNullOrEmpty(options.BackgroundColor) || options.UnplayedCount.HasValue || options.AddPlayedIndicator || options.PercentPlayed > 0;
@@ -98,8 +98,6 @@ namespace Emby.Drawing.GDI
var newWidth = Convert.ToInt32(width);
var newHeight = Convert.ToInt32(height);
var selectedOutputFormat = options.OutputFormat;
// Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here
// Also, Webp only supports Format32bppArgb and Format32bppRgb
var pixelFormat = selectedOutputFormat == ImageFormat.Webp