aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Dto/DtoService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs26
1 files changed, 23 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index e47ebc551..ec54033df 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -1786,11 +1786,31 @@ namespace MediaBrowser.Server.Implementations.Dto
}
}
- if (size.Width > 0 && size.Height > 0)
+ var width = size.Width;
+ var height = size.Height;
+
+ if (width == 0 || height == 0)
{
- return size.Width / size.Height;
+ return null;
}
- return null;
+
+ var photo = item as Photo;
+ if (photo != null && photo.Orientation.HasValue)
+ {
+ switch (photo.Orientation.Value)
+ {
+ case ImageOrientation.LeftBottom:
+ case ImageOrientation.LeftTop:
+ case ImageOrientation.RightBottom:
+ case ImageOrientation.RightTop:
+ var temp = height;
+ height = width;
+ width = temp;
+ break;
+ }
+ }
+
+ return width / height;
}
}
}