diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-11-11 09:56:31 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-11-11 09:56:31 -0500 |
| commit | cc19ce0daf3edb46d1acffdf2af98787cc9f7f5a (patch) | |
| tree | 03055ae936c198e1ab85ca76c869fa39c96971c9 /Emby.Drawing/ImageProcessor.cs | |
| parent | db8e51edb63b05c79d51134157e94a5cab9951a2 (diff) | |
added new parent methods
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 902ade448..e1b92bbff 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -259,6 +259,16 @@ namespace Emby.Drawing _imageEncoder.EncodeImage(originalImagePath, cacheFilePath, newWidth, newHeight, quality, options, outputFormat); } + + return new Tuple<string, string>(cacheFilePath, GetMimeType(outputFormat, cacheFilePath)); + } + catch (Exception ex) + { + // If it fails for whatever reason, return the original image + _logger.ErrorException("Error encoding image", ex); + + // Just spit out the original file if all the options are default + return new Tuple<string, string>(originalImagePath, MimeTypes.GetMimeType(originalImagePath)); } finally { @@ -269,8 +279,6 @@ namespace Emby.Drawing semaphore.Release(); } - - return new Tuple<string, string>(cacheFilePath, GetMimeType(outputFormat, cacheFilePath)); } private string GetMimeType(ImageFormat format, string path) |
