Jump to content

PrimaryImageAspectRatio not working as expected (returns 0.66666 for many images)


flight

Recommended Posts

I'd like to use the PrimaryImageAspectRatio field to lookup the aspect ratio of the primary image in order to decide whether it is landscape or portrait.

 

From the description, I expected PrimaryImageAspectRatio to return the aspect ratio of the primary image of that item.

 

I have the impression, though, that PrimaryImageAspectRatio is always 0.666666666666667 for movies and always 1.77777777777778 for tvshows - even if the actual primary images have other aspect ratios. For other items (e.g. folders), it seems to reflect the actual aspect ratio of the images, though.

 

I would expect that the field "PrimaryImageAspectRatio" delivered by "/Users/USERID/Items/MOVIEID?format=json&fields=PrimaryImageAspectRatio" should return the aspect ratio of the image returned by "/Items/MOVIEID/Images/Primary". Is this correct?

 

I have many examples where this is not the case.

 

E.g. "curl http://emby.lan/emby/Users/USERID/Items/MOVIEID?format=json&fields=PrimaryImageAspectRatio"says:

   ...

   "PrimaryImageAspectRatio" : 0.666666666666667,
   ...

 

while "wget http://emby.lan/emby/Items/MOVIEID/Images/Primary -O /tmp/primary.tmp" returns a landscape image. "file /tmp/primary.tmp" outputs an aspect ratio of "600x254".

 

 

Is this a bug of PrimaryImageAspectRatio, or is it a feature?

Link to comment
Share on other sites

We have stopped dynamically checking image dimensions on the fly for performance reasons. Instead we've just decided to standardize the aspect ratios, so for example movie posters are expected to be 2:3, music albums 1:1, etc. something like episode images are expected to be 16:9 however apps should avoid stretching to fill, and then if it happens to be 4:3 it will still work.

 

The apps are not aware of this change as they still check and respect the aspect ratio value, so as long as the property exists the server will have the freedom to change it's behavior if we decide to do that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...