diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 10:36:25 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 10:36:25 -0500 |
| commit | b07193e1bc76555e6c7eaa1111115694d4988c86 (patch) | |
| tree | a686621ffa40c7a81e22244f0b953df2f4bdee51 /MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs | |
| parent | 9758adb8a57e3b43013d9feabdf413af6c964a0f (diff) | |
added image processor error handling
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs index fd980abc8..bcbbe3b9e 100644 --- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs +++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs @@ -53,7 +53,6 @@ namespace MediaBrowser.Server.Implementations.Drawing private readonly IJsonSerializer _jsonSerializer; private readonly IServerApplicationPaths _appPaths; - private readonly string _imageSizeCachePath; private readonly string _croppedWhitespaceImageCachePath; private readonly string _enhancedImageCachePath; private readonly string _resizedImageCachePath; @@ -65,7 +64,6 @@ namespace MediaBrowser.Server.Implementations.Drawing _jsonSerializer = jsonSerializer; _appPaths = appPaths; - _imageSizeCachePath = Path.Combine(appPaths.ImageCachePath, "image-sizes"); _croppedWhitespaceImageCachePath = Path.Combine(appPaths.ImageCachePath, "cropped-images"); _enhancedImageCachePath = Path.Combine(appPaths.ImageCachePath, "enhanced-images"); _resizedImageCachePath = Path.Combine(appPaths.ImageCachePath, "resized-images"); @@ -78,11 +76,17 @@ namespace MediaBrowser.Server.Implementations.Drawing { sizeDictionary = jsonSerializer.DeserializeFromFile<Dictionary<Guid, ImageSize>>(ImageSizeFile); } - catch (IOException) + catch (FileNotFoundException) { // No biggie sizeDictionary = new Dictionary<Guid, ImageSize>(); } + catch (Exception ex) + { + logger.ErrorException("Error parsing image size cache file", ex); + + sizeDictionary = new Dictionary<Guid, ImageSize>(); + } _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary); } |
