aboutsummaryrefslogtreecommitdiff
path: root/Emby.Photos/PhotoProvider.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-22 02:22:43 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-22 02:22:43 -0400
commit7e5036a5875cb7f03ad728f970d66471ca30236b (patch)
tree31bb5509c42e490e1359483b7f047f63499317d6 /Emby.Photos/PhotoProvider.cs
parent7e2c52936ff15c2569a5cb6b3c5351c16c4163ff (diff)
update image aspect ratio detection
Diffstat (limited to 'Emby.Photos/PhotoProvider.cs')
-rw-r--r--Emby.Photos/PhotoProvider.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs
index 3a29b86a5..11a7db47d 100644
--- a/Emby.Photos/PhotoProvider.cs
+++ b/Emby.Photos/PhotoProvider.cs
@@ -163,10 +163,14 @@ namespace Emby.Photos
if (!item.Width.HasValue || !item.Height.HasValue)
{
- var size = _imageProcessor.GetImageSize(item.Path);
+ var img = item.GetImageInfo(ImageType.Primary, 0);
+ var size = _imageProcessor.GetImageSize(item, img, false, false);
- item.Width = Convert.ToInt32(size.Width);
- item.Height = Convert.ToInt32(size.Height);
+ if (size.Width > 0 && size.Height > 0)
+ {
+ item.Width = Convert.ToInt32(size.Width);
+ item.Height = Convert.ToInt32(size.Height);
+ }
}
const ItemUpdateType result = ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataImport;