diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-22 16:33:01 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-22 16:33:01 -0400 |
| commit | 31b01cbb5645cdc71791c85f2607aafbc6568dbc (patch) | |
| tree | 4d3472bb0d26fcf98511b07a0e33c174ea7300ce /MediaBrowser.Controller/Entities/Photo.cs | |
| parent | 2d29d903be8af52a953bf847e1f6b168fbb236cc (diff) | |
add fixes for dng images
Diffstat (limited to 'MediaBrowser.Controller/Entities/Photo.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Photo.cs | 29 |
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; } |
