diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-03-12 16:40:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-12 16:40:20 +0100 |
| commit | 58068e249a7b532caa78ea4e3401990ee365d48e (patch) | |
| tree | 187991ed1b6f3315e56970ed0b0d04b5ab5255b7 | |
| parent | 1fef8bf266480dc41cdf7ab80d1deac54dedad3d (diff) | |
| parent | 7322485a6d264037f2e26bf40bac93d6598e7bff (diff) | |
Merge pull request #1094 from cvium/imageprocessor_exception
Skip processing of images that don't exist
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 8 |
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 |
