diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-10-22 02:22:43 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-10-22 02:22:43 -0400 |
| commit | 7e5036a5875cb7f03ad728f970d66471ca30236b (patch) | |
| tree | 31bb5509c42e490e1359483b7f047f63499317d6 /Emby.Server.Implementations/Dto | |
| parent | 7e2c52936ff15c2569a5cb6b3c5351c16c4163ff (diff) | |
update image aspect ratio detection
Diffstat (limited to 'Emby.Server.Implementations/Dto')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index ef66c201c3..a0176e406c 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1608,12 +1608,12 @@ namespace Emby.Server.Implementations.Dto /// <param name="dto">The dto.</param> /// <param name="item">The item.</param> /// <returns>Task.</returns> - public void AttachPrimaryImageAspectRatio(IItemDto dto, IHasMetadata item) + public void AttachPrimaryImageAspectRatio(IItemDto dto, BaseItem item) { dto.PrimaryImageAspectRatio = GetPrimaryImageAspectRatio(item); } - public double? GetPrimaryImageAspectRatio(IHasMetadata item) + public double? GetPrimaryImageAspectRatio(BaseItem item) { var imageInfo = item.GetImageInfo(ImageType.Primary, 0); @@ -1646,12 +1646,14 @@ namespace Emby.Server.Implementations.Dto return null; } - return null; - _logger.Info("Getting image size for item type {0}", item.GetType().Name); - try { - size = _imageProcessor.GetImageSize(imageInfo); + size = _imageProcessor.GetImageSize(item, imageInfo); + + if (size.Width <= 0 || size.Height <= 0) + { + return null; + } } catch { |
