aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Images/ImageService.cs
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.Api/Images/ImageService.cs
parent52776df0129f73f7d0f87e9c51629241c5c4a7de (diff)
fixes #552 - Add parental control usage limits
Diffstat (limited to 'MediaBrowser.Api/Images/ImageService.cs')
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs18
1 files changed, 16 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index d455290be6..ca54249b31 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -321,6 +321,20 @@ namespace MediaBrowser.Api.Images
{
var fileInfo = new FileInfo(info.Path);
+ int? width = null;
+ int? height = null;
+
+ try
+ {
+ var size = _imageProcessor.GetImageSize(info.Path, info.DateModified);
+
+ width = Convert.ToInt32(size.Width);
+ height = Convert.ToInt32(size.Height);
+ }
+ catch
+ {
+
+ }
return new ImageInfo
{
Path = info.Path,
@@ -328,8 +342,8 @@ namespace MediaBrowser.Api.Images
ImageType = info.Type,
ImageTag = _imageProcessor.GetImageCacheTag(item, info),
Size = fileInfo.Length,
- Width = info.Width ?? 0,
- Height = info.Height ?? 0
+ Width = width,
+ Height = height
};
}
catch (Exception ex)