aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-15 17:14:51 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-15 17:14:51 -0400
commit077a2dc12dba122f56c3c9cc5015dfb63a2fb800 (patch)
tree02964c876f6f72c734cfb0a4fd75a749ee39230e
parent7446d2803d26fa4cb4ef86f1b3014c837f08f66d (diff)
update a/r calculation
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index d784bcb09..0b66a8e1f 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -1582,24 +1582,30 @@ namespace Emby.Server.Implementations.Dto
ImageSize size;
- if (supportedEnhancers.Count == 0)
- {
- var defaultAspectRatio = item.GetDefaultPrimaryImageAspectRatio();
+ var defaultAspectRatio = item.GetDefaultPrimaryImageAspectRatio();
- if (defaultAspectRatio.HasValue)
+ if (defaultAspectRatio.HasValue)
+ {
+ if (supportedEnhancers.Count == 0)
{
return defaultAspectRatio.Value;
}
- }
- try
- {
- size = _imageProcessor.GetImageSize(imageInfo);
+ double dummyWidth = 200;
+ double dummyHeight = dummyWidth / defaultAspectRatio.Value;
+ size = new ImageSize(dummyWidth, dummyHeight);
}
- catch
+ else
{
- //_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
- return null;
+ try
+ {
+ size = _imageProcessor.GetImageSize(imageInfo);
+ }
+ catch
+ {
+ //_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
+ return null;
+ }
}
foreach (var enhancer in supportedEnhancers)