diff options
Diffstat (limited to 'Emby.Server.Implementations/Dto/DtoService.cs')
| -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 ef66c201c..a0176e406 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 { |
