aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Photo.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-22 16:33:01 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-22 16:33:01 -0400
commit31b01cbb5645cdc71791c85f2607aafbc6568dbc (patch)
tree4d3472bb0d26fcf98511b07a0e33c174ea7300ce /MediaBrowser.Controller/Entities/Photo.cs
parent2d29d903be8af52a953bf847e1f6b168fbb236cc (diff)
add fixes for dng images
Diffstat (limited to 'MediaBrowser.Controller/Entities/Photo.cs')
-rw-r--r--MediaBrowser.Controller/Entities/Photo.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.cs
index 8e9eac50c..11db633ba 100644
--- a/MediaBrowser.Controller/Entities/Photo.cs
+++ b/MediaBrowser.Controller/Entities/Photo.cs
@@ -62,6 +62,35 @@ namespace MediaBrowser.Controller.Entities
return true;
}
+ public override double? GetDefaultPrimaryImageAspectRatio()
+ {
+ if (Width.HasValue && Height.HasValue)
+ {
+ double width = Width.Value;
+ double height = Height.Value;
+
+ if (Orientation.HasValue)
+ {
+ switch (Orientation.Value)
+ {
+ case ImageOrientation.LeftBottom:
+ case ImageOrientation.LeftTop:
+ case ImageOrientation.RightBottom:
+ case ImageOrientation.RightTop:
+ var temp = height;
+ height = width;
+ width = temp;
+ break;
+ }
+ }
+
+ width /= Height.Value;
+ return width;
+ }
+
+ return base.GetDefaultPrimaryImageAspectRatio();
+ }
+
public int? Width { get; set; }
public int? Height { get; set; }
public string CameraMake { get; set; }