aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-03-11 20:44:12 +0100
committerClaus Vium <clausvium@gmail.com>2019-03-11 20:44:12 +0100
commit7322485a6d264037f2e26bf40bac93d6598e7bff (patch)
tree992cc0fe5b379cd708a28487dcb20f4311f7c0af /Emby.Drawing/ImageProcessor.cs
parentc6c398179a7d7704b6abea42a0be980cac62c8ab (diff)
Skip processing of images that don't exist
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index faaeb5af8..6d209d8d0 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -180,6 +180,12 @@ namespace Emby.Drawing
var supportedImageInfo = await GetSupportedImage(originalImagePath, dateModified).ConfigureAwait(false);
originalImagePath = supportedImageInfo.path;
+
+ if (!File.Exists(originalImagePath))
+ {
+ return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
+ }
+
dateModified = supportedImageInfo.dateModified;
bool requiresTransparency = TransparentImageTypes.Contains(Path.GetExtension(originalImagePath));
@@ -265,8 +271,6 @@ namespace Emby.Drawing
{
// If it fails for whatever reason, return the original image
_logger.LogError(ex, "Error encoding image");
-
- // Just spit out the original file if all the options are default
return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
}
finally