Bugzilla – Bug 3781
.BMP embedded in songs is not scaled properly in gallery view
Last modified: 2008-09-15 14:39:24 UTC
I have an album where the artwork is embedded in each song (200x200). If I view this artist's albums in gallery view mode, the album is displayed in its original 200x200 size, whilst all other album artwork is scaled to 100x100.
I seem to recall that you said your library was flac, Philip?
I ought to come up with some test content with embedded graphics.
My library uses many formats ;-) It is unusual for me to use embedded artwork. It was probably put in there by some tagging tool in the past that I no longer use. Most new rips I do in FLAC format. However, my wife uses WMP and thus uses WMA or MP3. As she also uses an iPod, some of this music has been converted to m4a. The album in question is mp3 format. I believe that every track has the same embedded image.
Created attachment 1358 [details] mp3 file with 200x200 embedded png Okay, I made the attached track with a 200x200 embedded image. However, on my system (SlimServer Version: 6.5b1 - 8509 - Windows XP - EN - cp1252) I don't see the bug you're reporting. Does this track work for you or does it also display the bug?
I inserted the track in my music library and used Browse Music Folder to access it (image came up at this point). I then tried to view it via Browse Albums (looking under t for Testalbum). It was listed, but no thumbnail and I can't click to view the album or play it. Maybe it only works if I do a scan. As partial scan is still broken, I will need to try a full rescan. I haven't got time now - will try that later.
dan had to put the artwork scan back in, so rescans are once again required for thumbnails :( tried it out myself, and it seems to work ok in firefox and IE here, even when I disable GD. However, I suppose it might have been able to cache the already processed data. try running slim.exe --d_graphics just to get the status of the GD load. If you still get the large image, try viewing properties. what is the url and sizes given there?
Performed a full rescan and still get the large artwork for the thumbnail. url=http://localhost:9000/music/1620/thumb_100x100_f_000000.jpg JPEG image, 200 x 200 pixels.
hrm. what about the page source around that image? if GD filed to load, the browser would have to handle the resizing. Given that filename, it would seem that GD isn't doing its job, so hopefully the flag to the template is being set properly and you'll see height tags.
Partial extract from the page source: <div style="width:100px;"> <div class="artworkImage" style="width: 100;"> <div style="width:100px;height:100px;"> <a href="/browsedb.html?hierarchy=contributor,album,track&artwork=1&orderBy=album.titlesort&level=2&contributor.id=126&album.id=197&player=00%3A04%3A20%3A05%3Aac%3A35" target="browser"> <img src="/music/1620/thumb_100x100_f_000000.jpg" alt="Both Sides Of The Gun" title="Both Sides Of The Gun"></a> </div> </div>
and what about slim.exe --d_graphics?
Do I need to do a full rescan with --d_graphics? Not seeing anything by browsing to the album list.
Looking back through these comments I realise that I haven't yet commented about the test file that chris attached. Chris' embedded artwork is fine. The mp3 track contains an embedded png file. My artwork doesn't work still. My mp3 tracks contain an embedded jpg file.
--d_graphics is only required for the startup debug output only. This will report if you have a working GD library or not. However, even when I force a failure, I'm getting teh sizing tags. No idea why you wouldn't but I suspect that there is some flaw in the GD library and it's handling of the file in your case.
Comment on attachment 1358 [details] mp3 file with 200x200 embedded png Easy to do since I'm all set up for it. I'll upload a jpeg version in a sec.
Created attachment 1361 [details] mp3 file with 200x200 embedded jpeg
that still seems fine with GD or with it forced to unusable. Wonder if we've got another case where slimserver thinks it shoudl work, but it doesn't. I think we'll still need to see the startup log with d_graphics, hoping that some message in there will make sense of it.
Here's the slimserver startup log with --d_graphics: 2006-07-22 23:33:43.4213 fontfile entry: full.2.font.bmp 2006-07-22 23:33:43.4218 fontfile entry: high.2.font.bmp 2006-07-22 23:33:43.4221 fontfile entry: huge.2.font.bmp 2006-07-22 23:33:43.4224 fontfile entry: large.2.font.bmp 2006-07-22 23:33:43.4227 fontfile entry: light.1.font.bmp 2006-07-22 23:33:43.4231 fontfile entry: light.2.font.bmp 2006-07-22 23:33:43.4234 fontfile entry: logo.font.bmp 2006-07-22 23:33:43.4237 fontfile entry: medium.1.font.bmp 2006-07-22 23:33:43.4240 fontfile entry: medium.2.font.bmp 2006-07-22 23:33:43.4253 fontfile entry: small.1.font.bmp 2006-07-22 23:33:43.4257 fontfile entry: small.2.font.bmp 2006-07-22 23:33:43.4260 fontfile entry: standard.1.font.bmp 2006-07-22 23:33:43.4263 fontfile entry: standard.2.font.bmp 2006-07-22 23:33:43.4317 Retrieving font data from font cache: P:\Music\SlimServer\trunk\server\Cache\fonts.bin 2006-07-22 23:33:43.4377 Trying to load GD Library for TTF support: ok 2006-07-22 23:33:43.4385 Using TTF for Unicode on Player Display. Font: [P:\Music\SlimServer\trunk\server\Graphics\CODE2000.TTF] 2006-07-22 23:33:43.5625 Scalar value @lyric_list[0] better written as $lyric_list[0] at P:\Music\SlimServer\trunk\server/Plugins/Lyrics.pm line 174. 2006-07-22 23:33:43.5626 Scalar value @lyric_list[1] better written as $lyric_list[1] at P:\Music\SlimServer\trunk\server/Plugins/Lyrics.pm line 175. 2006-07-22 23:33:44.3437 "my" variable $title masks earlier declaration in same scope at P:\Music\SlimServer\trunk\server/Plugins/MyPicks/Plugin.pm line 712, <DATA> line 1. 2006-07-22 23:33:44.3724 defined(%hash) is deprecated at P:\Music\SlimServer\trunk\server/Plugins/SQLPlayList/Plugin.pm line 1933, <DATA> line 1. 2006-07-22 23:33:44.3725 (Maybe you should just omit the defined()?) 2006-07-22 23:33:44.4423 Subroutine new redefined at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Time/Stopwatch.pm line 27, <DATA> line 1. 2006-07-22 23:33:44.4449 Subroutine clear redefined at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Time/Stopwatch.pm line 36, <DATA> line 1. 2006-07-22 23:33:44.4451 Subroutine start redefined at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Time/Stopwatch.pm line 49, <DATA> line 1. 2006-07-22 23:33:44.4453 Subroutine stop redefined at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Time/Stopwatch.pm line 67, <DATA> line 1. 2006-07-22 23:33:44.4454 Subroutine getElapsedTime redefined at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Time/Stopwatch.pm line 90, <DATA> line 1. 2006-07-22 23:33:44.4717 "my" variable $agentName masks earlier declaration in same scope at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Scrobbler/Session.pm line 113, <DATA> line 64. 2006-07-22 23:33:44.8723 Use of uninitialized value in concatenation (.) or string at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Scrobbler/Session.pm line 119, <DATA> line 1. 2006-07-22 23:33:44.8724 Use of uninitialized value in concatenation (.) or string at P:\Music\SlimServer\trunk\server\Plugins\SlimScrobbler\SlimScrobbleSupport/Scrobbler/Session.pm line 119, <DATA> line 1. 2006-07-22 23:33:45.1788 Warning: Slim::Music::Info::getCurrentDataStore() is deprecated. Please use Slim::Schema directly. 2006-07-22 23:33:45.1791 Use of uninitialized value in concatenation (.) or string at P:\Music\SlimServer\trunk\server/Plugins/AlarmPlugin.pm line 536, <DATA> line 1.
ok, no help there :( other other thing would be d_artwork, while loading the browse_artwork page that contains that file. There are several message there, including "GD wouldn't create image object". Let's look for that, and see if something leading up to it gives a hint why this isn't working for you.
Okay. I browsed to Artists->[H letter link]->Ben Harper, and get a page containing only Ben Harper albums (in list view mode). I switched to gallery view and grabbed the following section out of the log: 2006-07-23 10:05:41.2195 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:05:41.2212 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg 2006-07-23 10:05:51.2310 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:05:51.2319 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg 2006-07-23 10:06:01.2930 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:06:01.2951 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg 2006-07-23 10:06:11.2714 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:06:11.2729 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg 2006-07-23 10:06:16.2207 Cover Art asking for: thumb at size 100x100 2006-07-23 10:06:16.2211 Retrieving artwork (thumb) for: file:///M:/Music/Live%20Concerts/Ben%20Harper/Live%202000-04-11/01%20-%20Welcome%20To%20The%20Cruel%20World.flac 2006-07-23 10:06:16.3043 coverArt: Found cached thumb file: M:\Music\Live Concerts\Ben Harper\Live 2000-04-11\folder.jpg 2006-07-23 10:06:16.3073 got cover art image image/jpeg of 485885 bytes 2006-07-23 10:06:16.6562 resizing from 1437x1414 to 100x98.3994432846207 using fitstretch 2006-07-23 10:06:16.9106 outputting cover art image image/jpeg of 3008 bytes 2006-07-23 10:06:16.9799 Cover Art asking for: thumb at size 100x100 2006-07-23 10:06:16.9803 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/Ben%20Harper/Both%20Sides%20of%20the%20Gun/01%20-%20Morning%20Yearning.mp3 2006-07-23 10:06:16.9805 readCoverArtTags: Looking for a cover art image in the tags of: [M:\Music\Phil's Music\Ben Harper\Both Sides of the Gun\01 - Morning Yearning.mp3] 2006-07-23 10:06:17.0202 readCoverArtTags: Found image of length [120045] bytes with type: [application/octet-stream] 2006-07-23 10:06:17.0214 got cover art image application/octet-stream of 120045 bytes 2006-07-23 10:06:17.0224 GD wouldn't create image object 2006-07-23 10:06:17.0571 Cover Art asking for: thumb at size 100x100 2006-07-23 10:06:17.0574 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/Ben%20Harper/Diamonds%20On%20The%20Inside/01%20-%20With%20My%20Two%20Hands.mp3 2006-07-23 10:06:17.0698 coverArt: Found cached thumb file: M:\Music\Phil's Music\Ben Harper\Diamonds On The Inside\albumartsmall.jpg 2006-07-23 10:06:17.0705 got cover art image image/jpeg of 1621 bytes 2006-07-23 10:06:17.0711 resizing from 75x64 to 100x85.3333333333333 using fitstretch 2006-07-23 10:06:17.0770 outputting cover art image image/jpeg of 2059 bytes 2006-07-23 10:06:21.3410 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:06:21.3420 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg Sure enough I see the "GD wouldn't create image object". It's also interesting that at no point do I see David Gray in the Web UI, but the log indicates it is getting artwork for David Gray several times. I even switched back to list view after I captured the above trace and got a list of Ben Harper albums, but the log contained: 2006-07-23 10:10:31.5345 Retrieving artwork (thumb) for: file:///M:/Music/Phil%27s%20Music/David%20Gray/White%20Ladder/10%20-%20Say%20Hello%20Wave%20Goodbye.wma 2006-07-23 10:10:31.5364 coverArt: Found cached thumb file: M:\Music\Phil's Music\David Gray\White Ladder\albumartsmall.jpg
playing David gray at the time perhaps? Or maybe it is the now playing song? the error would indicate that GD::Image->new is failing for some reason. Perhaps change the debug error line, in Slim/Web/Graphics.pm (not sure of exact line post-shocker merge) to: $::d_artwork && msg("GD wouldn't create image object: $@\n"); That should report the last error, if any is reported by GD. you'll have to run manually, slim.exe --d_artwork in order to run with this change included.
I don't think I had David Gray in my playlist. I made that change to the error report, but when I ran slimserver from the command prompt I got: 2006-07-26 08:54:40.9642 Use of uninitialized value in string ne at P:\Music\SlimServer\trunk\server/Slim/Display/Graphics.pm line 197. I actually changed line 238 - it's not getting that far now.
you should have changed Web/Graphics, the error is from Display/Graphics and shouldn't be causing the server to fail. It is just a result of the shocker merge and is only reporting some holes in player ui calls.
I did change Slim/Web/Graphics.pm. I didn't read the error message closely enough - the error was not in the file I changed! I ran slimserver.pl --d_artwork again today. No error report at startup, but when I view gallery: 2006-07-26 19:54:21.4807 Cover Art asking for: thumb at size 100x100 2006-07-26 19:54:21.4812 Retrieving artwork (thumb) for: file:///M:/Music/Live%2 0Concerts/Ben%20Harper/Live%202000-04-11/01%20-%20Welcome%20To%20The%20Cruel%20W orld.flac 2006-07-26 19:54:21.4865 coverArt: Found cached thumb file: M:\Music\Live Concer ts\Ben Harper\Live 2000-04-11\folder.jpg 2006-07-26 19:54:21.4892 got cover art image image/jpeg of 485885 bytes 2006-07-26 19:54:21.6718 resizing from 1437x1414 to 100x98.3994432846207 using fitstretch 2006-07-26 19:54:21.9432 outputting cover art image image/jpeg of 3008 bytes 2006-07-26 19:54:21.9656 Cover Art asking for: thumb at size 100x100 2006-07-26 19:54:21.9660 Retrieving artwork (thumb) for: file:///M:/Music/Phil%2 7s%20Music/Ben%20Harper/Both%20Sides%20of%20the%20Gun/01%20-%20Morning%20Yearnin g.mp3 2006-07-26 19:54:21.9666 readCoverArtTags: Looking for a cover art image in the tags of: [M:\Music\Phil's Music\Ben Harper\Both Sides of the Gun\01 - Morning Ye arning.mp3] 2006-07-26 19:54:21.9862 readCoverArtTags: Found image of length [120045] bytes with type: [application/octet-stream] 2006-07-26 19:54:22.9934 got cover art image application/octet-stream of 12004 5 bytes 2006-07-26 19:54:22.9993 GD wouldn't create image object: 2006-07-26 19:54:22.0207 Cover Art asking for: thumb at size 100x100 2006-07-26 19:54:22.0211 Retrieving artwork (thumb) for: file:///M:/Music/Phil%2 7s%20Music/Ben%20Harper/Diamonds%20On%20The%20Inside/01%20-%20With%20My%20Two%20 Hands.mp3 2006-07-26 19:54:22.0222 coverArt: Found cached thumb file: M:\Music\Phil's Musi c\Ben Harper\Diamonds On The Inside\albumartsmall.jpg 2006-07-26 19:54:22.0235 got cover art image image/jpeg of 1621 bytes 2006-07-26 19:54:22.0294 resizing from 75x64 to 100x85.3333333333333 using fit stretch 2006-07-26 19:54:22.0361 outputting cover art image image/jpeg of 2059 bytes
something is either wrong with GD or wrong with the embedded image and GD isn't reporting anything back for us to work with. Have you tried Chris' attached file with jpg image? Could you attach the file you are having a problem with? The steps from here involve hacking GD, and it could get messy with me adding comments for which lines to add debugs, over and over.
I can't rescan at the moment, and can't view more than one thumbnail in gallery view before my server crashes. I will come back to this when 6.5 is a bit more stable again.
Subject: Re: Artwork embedded in songs is not scaled properly in gallery view I need to fix the years table issue - it will be stable again after that.
I just extracted the artwork from one of my mp3 files. I was wrong - it wasn't embedded jpeg, it is in fact embedded as a .bmp. 200x200 24 bit. I added it to a copy of the test mp3 file. After a rescan, the test file displays a 200x200 thumbnail. I will attach this test file.
Created attachment 1379 [details] An mp3 file with artwork embedded in bmp format
the server does not check for bmp format with GD. if GD is failing, it is likely because it is not compiled with bmp support, if that's even possible. end result, embedded bmp is not supported.
Ok - so GD (the graphics lib we are using for resizing) doesn't support BMP files. Change 8703 however identifies BMP files as image/bmp, so the server should at least display them, but not resize them.
So it sounds like the bug is reporting expected behavior. Do we want to make a request to the GD team that they support .BMP? Do we want to mark this as fix for 'Future' in case we ever consider other graphics libraries? Do we want to just mark it 'wontfix' for now?
The "GD Team" really isn't.. it's one guy, and he doesn't take requests. I'm going to mark this as WONTFIX (First time I've seen a BMP in a file) - Phil, just convert the BMP to JPG or PNG and re-add it to the file.
Sorry, I didn't know that .bmp wasn't supported. I have already removed the embedded artwork to use a folder.jpg file instead (consistent with the rest of my library). I initially thought it was embedded jpg as slimserver properties for the 200x200 thumbnail was linked to http://localhost:9000/music/8352/thumb_100x100_f_000000.jpg. I think perhaps you should update the Help -> Technical Information -> Artwork Setup page to detail supported file formats for embedded artwork.
already added a note to the wiki