aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Dto
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-14 20:05:09 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-14 20:05:09 -0400
commitbd1bd5e87e1744b363279577a6550afc5f2229c1 (patch)
treedcee85b1a7e0d3243702a6df6cc422f45609870f /MediaBrowser.Server.Implementations/Dto
parent52776df0129f73f7d0f87e9c51629241c5c4a7de (diff)
fixes #552 - Add parental control usage limits
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto')
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs34
1 files changed, 10 insertions, 24 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index c2ac386eb6..366a5558b1 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -1429,35 +1429,21 @@ namespace MediaBrowser.Server.Implementations.Dto
// See if we can avoid a file system lookup by looking for the file in ResolveArgs
var dateModified = imageInfo.DateModified;
- double? width = imageInfo.Width;
- double? height = imageInfo.Height;
-
ImageSize size;
- if (!width.HasValue || !height.HasValue)
+ try
{
- try
- {
- size = _imageProcessor.GetImageSize(path, dateModified);
- }
- catch (FileNotFoundException)
- {
- _logger.Error("Image file does not exist: {0}", path);
- return;
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
- return;
- }
+ size = _imageProcessor.GetImageSize(path, dateModified);
}
- else
+ catch (FileNotFoundException)
{
- size = new ImageSize
- {
- Height = height.Value,
- Width = width.Value
- };
+ _logger.Error("Image file does not exist: {0}", path);
+ return;
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
+ return;
}
dto.OriginalPrimaryImageAspectRatio = size.Width / size.Height;