mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update a/r calculation
This commit is contained in:
parent
7446d2803d
commit
077a2dc12d
@ -1582,24 +1582,30 @@ namespace Emby.Server.Implementations.Dto
|
|||||||
|
|
||||||
ImageSize size;
|
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;
|
return defaultAspectRatio.Value;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try
|
double dummyWidth = 200;
|
||||||
{
|
double dummyHeight = dummyWidth / defaultAspectRatio.Value;
|
||||||
size = _imageProcessor.GetImageSize(imageInfo);
|
size = new ImageSize(dummyWidth, dummyHeight);
|
||||||
}
|
}
|
||||||
catch
|
else
|
||||||
{
|
{
|
||||||
//_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
|
try
|
||||||
return null;
|
{
|
||||||
|
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)
|
foreach (var enhancer in supportedEnhancers)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user