diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-01 15:26:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-01 15:26:02 -0400 |
| commit | 03b93e02b986af5610fa2cd2b848bdf32f9d20d7 (patch) | |
| tree | e99f1c3e83354de8edc8b739c84a7e82731df081 /Emby.Drawing/ImageProcessor.cs | |
| parent | 00cb873164fb1619a2291e79bb53f3edcedcd731 (diff) | |
| parent | ac904c8ed0f79f63b61bdd0460a9f5a3b9ced65d (diff) | |
Merge pull request #2857 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 8f3042e2a..356343bae 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -296,11 +296,6 @@ namespace Emby.Drawing var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(cacheFilePath)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(tmpPath)); - if (item == null && string.Equals(options.ItemType, typeof(Photo).Name, StringComparison.OrdinalIgnoreCase)) - { - item = _libraryManager().GetItemById(options.ItemId); - } - if (options.CropWhiteSpace && !SupportsTransparency(originalImagePath)) { options.CropWhiteSpace = false; @@ -321,6 +316,15 @@ namespace Emby.Drawing return new Tuple<string, string, DateTime>(cacheFilePath, GetMimeType(outputFormat, cacheFilePath), _fileSystem.GetLastWriteTimeUtc(cacheFilePath)); } + catch (ArgumentOutOfRangeException ex) + { + // Decoder failed to decode it +#if DEBUG + _logger.ErrorException("Error encoding image", ex); +#endif + // Just spit out the original file if all the options are default + return new Tuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified); + } catch (Exception ex) { // If it fails for whatever reason, return the original image |
