Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,305

    content-type of images from cache (proxy)

    PNG icons were not displayed properly on AppleTV using my AirPlay Bridge plugin.

    AppleTV does not grab the image from an URL, but requires the binary data to be passed directly in a RTSP connection. My plugin is getting the icon from LMS through an HTTP request and then forwards the data. I thought AppleTV was only accepting JPEG, so I did a png-to-jpeg transcoder that was supposed to be called when the content-type sent by LMS was image/png. But the transcoder was never called and I realised the problem is different.

    LMS seems to always force "Content-Type: image/jpeg" when sending icons from proxy/cache, although the image is PNG, hence the AppleTV was confused. To make sure, I forced Content-type to image/png when the (cached) url extension is .png and the icon was immediately displayed on the AppleTV.

    I've not identified what part of LMS code is the cause, but it really seems to be an issue
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781

    content-type of images from cache (proxy)

    Could you enable debug logging for artwork?

    I'm out for a while, but can look into this in August. This certainly should work as expected.

    > Am 16.07.2017 um 07:48 schrieb philippe_44 <philippe_44.81pnxb (AT) no-mx (DOT) forums.slimdevices.com>:
    >
    >
    > PNG icons were not displayed properly on AppleTV using my AirPlay Bridge
    > plugin.
    >
    > AppleTV does not grab the image from an URL, but requires the binary
    > data to be passed directly in a RTSP connection. My plugin is getting
    > the icon from LMS through an HTTP request and then forwards the data. I
    > thought AppleTV was only accepting JPEG, so I did a png-to-jpeg
    > transcoder that was supposed to be called when the content-type sent by
    > LMS was image/png. But the transcoder was never called and I realised
    > the problem is different.
    >
    > LMS seems to always force "Content-Type: image/jpeg" when sending icons
    > from proxy/cache, although the image is PNG, hence the AppleTV was
    > confused. To make sure, I forced Content-type to image/png when the
    > (cached) url extension is .png and the icon was immediately displayed on
    > the AppleTV.
    >
    > I've not identified what part of LMS code is the cause, but it really
    > seems to be an issue
    >
    >
    >
    > LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos
    > PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000,
    > ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi
    > B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010,
    > AppleTV 4, Airport Express
    > ------------------------------------------------------------------------
    > philippe_44's Profile: http://forums.slimdevices.com/member.php?userid=17261
    > View this thread: http://forums.slimdevices.com/showthread.php?t=107675
    >
    >

  3. #3
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,305
    Quote Originally Posted by mherger View Post
    Could you enable debug logging for artwork?

    I'm out for a while, but can look into this in August. This certainly should work as expected.
    I've added a server log and an extra of what my plugin gets. As said in the file, content-type is image/jpeg when I "GET" this url.

    There is no rush at all on my side, I've created a workaround that works just fine

    Enjoy your vacation !
    Attached Files Attached Files
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781

    content-type of images from cache (proxy)

    > I've added a server log and an extra of what my plugin gets. As said in
    > the file, content-type is image/jpeg when I "GET" this url.


    Could you please enable logging for artwork and try again? I didn't find
    anything relevant in that log file.

    Also: is this a 7.7.5 issue only, or can you reproduce it with anything
    more recent?

    --

    Michael

  5. #5
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,305
    Quote Originally Posted by mherger View Post
    > I've added a server log and an extra of what my plugin gets. As said in
    > the file, content-type is image/jpeg when I "GET" this url.


    Could you please enable logging for artwork and try again? I didn't find
    anything relevant in that log file.

    Also: is this a 7.7.5 issue only, or can you reproduce it with anything
    more recent?

    --

    Michael
    Got back home recently, so I was able to make a proper log. The previous one was a wrong upload and did not contain anything relevant, sorry. This is LMS 7.9.0, Windows

    This is the server.log, playing something from deezer. As you can see, the coverart is a png file. I'm not sure I understand why it says that it got cached artwork of type jpg, I guessed it does transcoding to everything to jpg
    Code:
    [17-08-17 20:18:42.9121] Slim::Web::ImageProxy::getImage (110) Get artwork for URL: imageproxy/http://api.deezer.com/2.0/album/40798221/image?size=xl/image.png
    [17-08-17 20:18:42.9129] Slim::Web::ImageProxy::getImage (123) Got cached artwork of type jpg and 129398 bytes length
    [17-08-17 20:18:46.4549] Slim::Web::Graphics::artworkRequest (80) Artwork request: music/-151847860/cover_96x96_p.png
    [17-08-17 20:18:46.4552] Slim::Web::Graphics::artworkRequest (120)   Resize specification: 96x96_p.png
    [17-08-17 20:18:46.4554] Slim::Web::Graphics::artworkRequest (286)   No cover found, translated to html/images/radio_96x96_p.png
    [17-08-17 20:18:46.4558] Slim::Web::Graphics::_cached (65)   from cache: png (6277 bytes for html/images/radio_96x96_p.png)
    [17-08-17 20:18:49.3376] Slim::Web::Graphics::artworkRequest (80) Artwork request: imageproxy/http://api.deezer.com/2.0/album/14229974/image?size=xl/image.png
    [17-08-17 20:18:49.3378] Slim::Web::Graphics::artworkRequest (120)   Resize specification: .png
    [17-08-17 20:18:49.3379] Slim::Web::ImageProxy::getImage (110) Get artwork for URL: imageproxy/http://api.deezer.com/2.0/album/14229974/image?size=xl/image.png
    [17-08-17 20:18:49.3389] Slim::Web::ImageProxy::getImage (123) Got cached artwork of type jpg and 144018 bytes length

    Then this is the log of my plugin. The metadata below is obtained through CLI. Once I got the artwork url, I query it to LMS and as you can see, although the file as an extension .png (and *is* a png, I verified that), the response to the GET says content-type is image/jpeg, hence the target player is confused. Again, no big deal as I look for .png in the url and then force content-type

    Code:
    [20:18:48.263] process_strm:233 [004A5758] strm command s
    [20:18:48.264] process_strm:307 [004A5758], strm s autostart: 3 transition period: 10 transition type: 0 codec: m
    [20:18:48.264] sq_callback:340 [00483708]: codec:m, ch:255, s:255, r:255
    [20:18:48.264] PlayerThread:476 [00483708]: raop connecting ...
    [20:18:48.264] PlayerThread:480 [00483708]: raop connected
    [20:18:48.282] PlayerThread:511 [00483708]: processing volume: 40 (-18.06)
    [20:18:48.499] raopcl_accept_frames:415 [023F0BE0]: begining to stream hts:163699867139853 n:3712015128.2146452855
    [20:18:48.499] raopcl_accept_frames:423 [023F0BE0]: restarting w/o pause n:3712015128.2146452855, hts:163699867166839
    [20:18:48.529] _output_frames:53 [004A5758]: start buffer frames: 16751
    [20:18:48.529] _output_frames:100 [004A5758]: track start sample rate: 44100 replay_gain: 0
    [20:18:48.539] output_raop_thread:99 [004A5758]: track actual start time:1163386005 (gap:1163386005)
    [20:18:48.769] raopcl_send_chunk:573 [023F0BE0]: check n:1163385025 p:1163386261 ts:163699867178455 sn:755
                   retr: 0, avail: 0, send: 0, select: 0)
    [20:18:49.341] PlayerThread:445 Content type returned for http://192.168.56.1:9000/imageproxy/http%3A%2F%2Fapi.deezer.com%2F2.0%2Falbum%2F14229974%2Fimage%3Fsize%3Dxl/image.png: image/jpeg
    [20:18:49.357] PlayerThread:464 [00483708]: idx 0
    	artist:Norah Jones
    	album:Day Breaks
    	title:Carry On
    	genre:[no genre]
    	duration:168.000
    	size:0
    	cover:http://192.168.56.1:9000/imageproxy/http%3A%2F%2Fapi.deezer.com%2F2.0%2Falbum%2F14229974%2Fimage%3Fsize%3Dxl/image.png
    Last edited by philippe_44; 2017-08-17 at 20:30.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781

    content-type of images from cache (proxy)

    What I forgot to ask: are you using LMS internal image resizing or
    mysb.com (see Settings/Performance)?

    --

    Michael

  7. #7
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781

    content-type of images from cache (proxy)

    > This is the server.log, playing something from deezer. As you can see,
    > the coverart is a png file. I'm not sure I understans why it says that
    > it got cached artwork of type jpg


    Thanks for the updated log file. This indeed does not look right. But I
    can't reproduce it. As asked in my previous mail: are you using mysb or
    the internal resizer for the proxy? Are you running the latest 7.9.1?

    And can you reproduce this issue with any external source, or is it limited to Deezer?

    Please wipe the imgproxy.db (while LMS is shut down). Then enable
    debugging for the imageproxy as you did. What I'm interested in is the
    content type information you get after the image proxy has received the
    original file.


    --

    Michael
    Last edited by mherger; 2017-08-17 at 22:07.

  8. #8
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,305
    Quote Originally Posted by mherger View Post
    > This is the server.log, playing something from deezer. As you can see,
    > the coverart is a png file. I'm not sure I understans why it says that
    > it got cached artwork of type jpg


    Thanks for the updated log file. This indeed does not look right. But I
    can't reproduce it. As asked in my previous mail: are you using mysb or
    the internal resizer for the proxy? Are you running the latest 7.9.1?

    And can you reproduce this issue with any external source, or is it limited to Deezer?

    Please wipe the imgproxy.db (while LMS is shut down). Then enable
    debugging for the imageproxy as you did. What I'm interested in is the
    content type information you get after the image proxy has received the
    original file.


    --

    Michael
    - this is LMS 7.9.0
    - mySB does the resizing
    - so far, all my other services (Qobuz, Tidal) send jpg images, so I've onyl be able to try with Deezer
    - I've wiped the cached db, here is the new log

    Code:
    [17-08-17 22:35:27.6261] Slim::Web::Graphics::artworkRequest (80) Artwork request: imageproxy/http://api.deezer.com/2.0/album/14229974/image?size=xl/image.png
    [17-08-17 22:35:27.6263] Slim::Web::Graphics::artworkRequest (120)   Resize specification: .png
    [17-08-17 22:35:27.6265] Slim::Web::ImageProxy::getImage (110) Get artwork for URL: imageproxy/http://api.deezer.com/2.0/album/14229974/image?size=xl/image.png
    [17-08-17 22:35:27.6267] Slim::Web::ImageProxy::__ANON__ (151) Found URL to get artwork: http://api.deezer.com/2.0/album/14229974/image?size=xl
    [17-08-17 22:35:28.3221] Slim::Web::ImageProxy::_gotArtwork (217) Received artwork of type image/jpeg and 144018 bytes length
    [17-08-17 22:35:28.3223] Slim::Web::ImageProxy::_resizeFromFile (289) No resizing required - already resized remotely, or original size requested
    Maybe then the guilty party is Deezer that does not send a proper content-type

    [edit]: well ... it's very funny. I'd wireshark'd what happens between LMS and the Deezer server. This url http://api.deezer.com/2.0/album/1422...e=xl/image.png is redirected to an http://e-cdn-images.deezer.com/image...000-80-0-0.jpg which is really a jpeg. it's then proxied by LMS and sent to me with a .png extension *but* a content-type image/jpeg but if I sent it to the AppleTV with the same content-type, it fails. If I change content-type to image/png it works ...

    oh well, Michael it does not seem to be really related to LMS, it might be a strange thing with AppleTV which wants extension and content-type to match *but* still recognize the file by the content and so is able to properly display it. A very contorded explanation but I don't have any better and I suggest we leave it there as the workaround in my plugin works and it's not a big deal

    [edit2]; and thinking about what I said earlier "I'm sure it's png, I verified it", I have to take that back. I was assuming that because sending a url xxxx/image.png and a content-type=image/png was the only way to make AppleTV display work (letting content-type=image/jpeg was not working), then the image *was* png. That assumption is probably wrong, but all that is very contorded
    Last edited by philippe_44; 2017-08-17 at 23:08.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,781
    Heh... never edit a posting! I'm likely to miss the edit :-). I only came here to the forum because pasting log snippets and the like is better done in the forum than though the mailing list. But what I wanted to post was basically the same conclusion as yours: the file extension is assuming png, no matter what the result is. Your use case probably is a bit special, as you're asking for the original file, but going through the proxy. Why not request the original file right away? The proxy is supposed to resize artwork. If it has to serve the full size image, it won't touch the data, but just return whatever it receives from the remote server. Therefore the jpeg data in png disguise.

    But it's not Deezer's problem: the image.png file extension is added in our code. Or yours, I'm not sure. The request to Deezer doesn't feature a file extension.

    http://api.deezer.com/2.0/album/14229974/image?size=xl

    Now you should figure out where the image.png is coming from. If it's under your control, I'd try to request the original file directly if you want to get the original anyway. Downloading a 144kB jpeg to blow it up to 3MB+ png just doesn't make sense (unless the client can't handle it otherwise, of course). Maybe AppleTV would behave better if there was no extension at all?
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  10. #10
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,305
    Quote Originally Posted by mherger View Post
    Heh... never edit a posting! I'm likely to miss the edit :-). I only came here to the forum because pasting log snippets and the like is better done in the forum than though the mailing list.
    ok, I won't :-)
    But what I wanted to post was basically the same conclusion as yours: the file extension is assuming png, no matter what the result is. Your use case probably is a bit special, as you're asking for the original file, but going through the proxy. Why not request the original file right away? The proxy is supposed to resize artwork. If it has to serve the full size image, it won't touch the data, but just return whatever it receives from the remote server. Therefore the jpeg data in png disguise.

    But it's not Deezer's problem: the image.png file extension is added in our code. Or yours, I'm not sure. The request to Deezer doesn't feature a file extension.

    http://api.deezer.com/2.0/album/14229974/image?size=xl
    No, that extension is not added by my code. All I do is query LMS through the following query "songinfo 0 10 url:%s tags:cfldatgrK". What I have in return is "/imageproxy/http%3A%2F%2Fapi.deezer.com%2F2.0%2Falbum%2F142299 74%2Fimage%3Fsize%3Dxl/image.png". The /image.png is added by LMS. Then when I GET that result from LMS, this is where I have thos content-type: image/jpeg.
    Remember that my plugin is an indpendant executable, it's not a Perl extension, so my access to some LMS information is limited to what I can get through CLI or similar.
    Now you should figure out where the image.png is coming from. If it's under your control, I'd try to request the original file directly if you want to get the original anyway. Downloading a 144kB jpeg to blow it up to 3MB+ png just doesn't make sense (unless the client can't handle it otherwise, of course). Maybe AppleTV would behave better if there was no extension at all?
    I can extract the deezer link in the artwork url returned by LMS, but I also think that the best solution now is to trust "content-type" returned by LMS and not the extension of the file, so in that case, I'd add a.jpg extension before sending that to AppleTV, rather continuing to let it dealign with the confusing .png and content-type=image/png but file is jpeg ...
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •