aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 23:49:38 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 23:49:38 -0400
commitdd9404ebc6e2e03bb4f0135e48a59211252615d9 (patch)
treef0e73b03d25d4a7f0bcba05ad638cd5e81ba6e90 /Emby.Drawing/ImageProcessor.cs
parent0f23c7cfc1372ead03ab9b818e698441d4d53bd3 (diff)
update skiasharp to 1.58.1
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs14
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