浏览代码

Skip processing of images that don't exist

Claus Vium 6 年之前
父节点
当前提交
7322485a6d
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      Emby.Drawing/ImageProcessor.cs

+ 6 - 2
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