diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-26 01:29:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-26 01:29:32 -0400 |
| commit | c80e1df1ca1b5b2a082bf6a10e0c4c35d3a31f3b (patch) | |
| tree | b4decdfd240182061ab55299b12798b429f7a82d /Emby.Drawing/ImageProcessor.cs | |
| parent | 2890c71af92dcb6920c4ab7da48cd6807ca86703 (diff) | |
support null image encoder
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 21 |
1 files changed, 20 insertions, 1 deletions
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<string, DateTime>(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 |
