From c80e1df1ca1b5b2a082bf6a10e0c4c35d3a31f3b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 26 Oct 2015 01:29:32 -0400 Subject: support null image encoder --- Emby.Drawing/ImageProcessor.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Emby.Drawing/ImageProcessor.cs') diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 05c156e6a..9d7d1dbe9 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -110,6 +110,15 @@ namespace Emby.Drawing } } + + public bool SupportsImageCollageCreation + { + get + { + return _imageEncoder.SupportsImageCollageCreation; + } + } + private string ResizedImageCachePath { get @@ -170,6 +179,11 @@ namespace Emby.Drawing var originalImagePath = originalImage.Path; + if (!_imageEncoder.SupportsImageEncoding) + { + return originalImagePath; + } + if (options.HasDefaultOptions(originalImagePath) && options.Enhancers.Count == 0 && !options.CropWhiteSpace) { // Just spit out the original file if all the options are default @@ -178,7 +192,7 @@ namespace Emby.Drawing var dateModified = originalImage.DateModified; - if (options.CropWhiteSpace) + if (options.CropWhiteSpace && _imageEncoder.SupportsImageEncoding) { var tuple = await GetWhitespaceCroppedImage(originalImagePath, dateModified).ConfigureAwait(false); @@ -295,6 +309,11 @@ namespace Emby.Drawing _imageEncoder.CropWhiteSpace(originalImagePath, croppedImagePath); } + catch (NotImplementedException) + { + // No need to spam the log with an error message + return new Tuple(originalImagePath, dateModified); + } catch (Exception ex) { // We have to have a catch-all here because some of the .net image methods throw a plain old Exception -- cgit v1.2.3