Jump to content

API ignores image dimension parameters


roaku
Go to solution Solved by Luke,

Recommended Posts

The API docs describes and recommends using image dimensions parameters when requesting images:

https://github.com/MediaBrowser/Emby/wiki/Images#width-height-maxwidth-maxheight

But in practice, the API seems to ignore dimension parameters.

This is the url generated by the web client:

/Items/{id}/Images/Primary?maxHeight=264&maxWidth=176&tag={cacheHash}&quality=90

It returns a 1000px W x 1500 px H image, despite the dimension parameters.

I get the same behavior no matter what parameters I experiment with from the documentation.

Is this a bug? Outdated documentation? Is there another way to constrain image size?

This isn't a huge deal, but my use case is thumbnails on a 7" inch screen, so I really don't need all that resolution.

Link to comment
Share on other sites

Hi, those look fine but I would compare to the urls used by the web app. Obviously it works in general or we'd have a serious problem on our hands.

Link to comment
Share on other sites

Hmm...My example link *is* from the web app.

When I download the image from that web app generated API request, it's 1000px x 1500px

When I use Firefox dev tools to inspect the image in context as a background image of a flexbox-ed button html element, Firefox says it's 500px x 750px.

These two are clearly fractionally related...but neither is the 264 x 176 the web app's request sets as the limit when it makes the request.

Link to comment
Share on other sites

Happy2Play

Not sure I follow.

images.thumb.jpg.16662190a916b08552a0d7ee27eafb85.jpg

380354253_image2.thumb.jpg.9238bdd981cf3971642b1b8b486c06f3.jpg

This is Chrome but see the same/similar in Firefox

Edited by Happy2Play
Link to comment
Share on other sites

This is what I see (the height is 1px taller than earlier):

IMG_20201112_210709.thumb.jpg.d235dfb7a26fe9ace4bcef695fed4e13.jpg

Edited by roaku
Accidentally a whole adjective
Link to comment
Share on other sites

47 minutes ago, Luke said:

Server log?

Here's a log snippet:

2020-11-12 20:00:03.631 Info HttpServer: HTTP GET http://[serverip]:8096/emby/Items/22520/Images/Primary?maxHeight=264&maxWidth=176&tag=27cc2bad8e3a3dd26717321746d39f0f&quality=90. UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
2020-11-12 20:00:03.646 Info HttpServer: HTTP Response 200 to [clientip]. Time: 15ms. http://[serverip]:8096/emby/Items/22520/Images/Primary?maxHeight=264&maxWidth=176&tag=27cc2bad8e3a3dd26717321746d39f0f&quality=90. ConnectionId: null

It all looks good from that side.

But it doesn't match the image dimensions I actually receive.

I'm also seeing 304s once the image has been retrieved, so the caching is working for me at least.

 

Edited by roaku
Link to comment
Share on other sites

Can you provide the log from when the server first started up? That's the midnight rollover log. Also when did you install Emby Server?

Link to comment
Share on other sites

I manually rolled the log over before downloading the previously attached log file. All my older embyserver log files look the same as that one in terms of the server info at the top.

The only other log file types I see are ffmpeg related and a hardware_detection one.

I'm not sure exactly when I installed Emby Server , but the folders it created say they were created on November 1st 2020.

 

Link to comment
Share on other sites

network-traffic.thumb.png.608a323b350b832e64996c9f3d680a96.pngJust to verify the w/h dimensions I'm seeing, here's what the web app is receiving from the server for images (this network log is from my Firefox on Windows with caching temporarily turned off).

The movie images at least are not being resized. I'm getting 1mb+ files in some cases.

 

Edited by roaku
Cropping malfunction
Link to comment
Share on other sites

18 minutes ago, Luke said:

Can you please restart Emby Server and then provide that log? Thanks.

Here's a log file with server restart up to and including me downloading the log file

embyserver(1).txt

Link to comment
Share on other sites

  • Solution

Can you try downloading the Emby Server package again from our website and installing over the top of your existing version? Thanks.

Link to comment
Share on other sites

22 minutes ago, Luke said:

Can you try downloading the Emby Server package again from our website and installing over the top of your existing version? Thanks.

Well, that seems to have done the trick. Images are much smaller and the dimension parameters are now being honored (they only transferred slowly because the server was just getting going).

Thanks.

May I ask if there was something in particular that caused my situation?

 

much-better-thanks.thumb.png.4cdd989a081a6488365fd390af40ec57.png

Edited by roaku
Link to comment
Share on other sites

The Synology package has been undergoing a lot of changes over the last couple months, so there must have been an issue at the time you installed your current version.

  • Thanks 1
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...