Skip Menu |

This queue is for tickets about the MP3-Tag CPAN distribution.

Report information
The Basics
Id: 66422
Status: open
Priority: 0/
Queue: MP3-Tag

People
Owner: Nobody in particular
Requestors: Marek.Rouchal [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.13
Fixed in: (no value)



Subject: APIC not shown on certain devices/platforms
I am about to develop a MP3 tagging software in Perl. Things are working pretty well already, but I am facing an issue with embedded pictures: after processing the ID3v2 tags with MP3::Tag, the embedded APICs don't get displayed e.g. in the Windows 7 explorer, nor on e.g. my LG cell phone - while other MP3s with APICs get displayed perfectly OK. I am at the end of my wisdom - especially since MP3::Tag reads and write ALL of these mp3s/ID3v2 tags and APICs OK. I tried various combinations of the config tags (unsync, recalculate,...), removing the ID3v2 tag first, or only editing the frames that changed - to no avail. See below a dump of frames from the same MP3 file, before and after editing. I can see no obvious difference, but the new one does not show the embedded pic (on the platforms described above). Can you help me to debug and fix this? I can send the MP3s, if that helps. Many thanks, Marek This is an MP3 with all its ID3v2 tags _before_ manipulation with MP3::Tag Tag Dump: ----- 01 Rebel Yell.mp3 FRAME APIC - Attached picture: --- Description: Album cover MIME type: image/jpg Picture Type: Cover (front) _Data: PIC (length=131290) encoding: 0 FRAME COMM - Comments: --- Description: '' Language: eng Text: Manufactured and Distributed By the Emi Music Group Australia. encoding: 0 FRAME IPLS - Involved people list: Written-By / Billy Idol (tracks: 1 to 5, 8 to 11) , Steve Stevens (tracks: 1, 4, 9) / Producer / Keith Forsey / Keyboards / Judi Dozier (tracks: 1, 4, 5, 9) / Drums / Thommy Price (tracks: 1, 4, 5, 6, 9) FRAME TALB - Album/Movie/Show title: Idol Songs - 11 of the Best FRAME TCON - Content type: Electronic, Rock FRAME TENC - Encoded by: FreeRIP 2.944 FRAME TIT2 - Title/songname/content description: Rebel Yell FRAME TPE1 - Lead performer(s)/Soloist(s): Billy Idol FRAME TPUB - Publisher: EMI Music (Australia), Chrysalis FRAME TRCK - Track number/Position in set: 01 FRAME TXXX - User defined text information frame: --- Description: TONES Text: 321660-2, Cdp 32 16602 encoding: 0 REST 0: --- Description: STYLES Text: New Wave, Pop Rock, Synth-Pop, Classic Rock encoding: 0 REST 1: --- Description: SITUATION Text: Australia encoding: 0 REST 2: --- Description: TYPE Text: CD encoding: 0 FRAME TXXX01 - User defined text information frame: --- Description: STYLES Text: New Wave, Pop Rock, Synth-Pop, Classic Rock encoding: 0 FRAME TXXX02 - User defined text information frame: --- Description: SITUATION Text: Australia encoding: 0 FRAME TXXX03 - User defined text information frame: --- Description: TYPE Text: CD encoding: 0 FRAME TYER - Year: 1988 NOT OK - after manipulation with MP3::Tag: Tag Dump ----- 01 Rebel Yell.mp3 FRAME APIC - Attached picture: --- Description: Album Cover MIME type: image/jpg Picture Type: Cover (front) _Data: PIC (length=131290) encoding: 0 FRAME COMM - Comments: --- Description: '' Language: eng Text: 'Manufactured and Distributed By the Emi Music Group Australia. ' encoding: 0 FRAME TALB - Album/Movie/Show title: Idol Songs - 11 of the Best FRAME TCON - Content type: Rock FRAME TDRC - Recording time: 1988 FRAME TIT2 - Title/songname/content description: Rebel Yell FRAME TPE1 - Lead performer(s)/Soloist(s): Billy Idol FRAME TRCK - Track number/Position in set: 01 FRAME TYER - Year: 1988
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #66422] APIC not shown on certain devices/platforms
Date: Sun, 6 Mar 2011 10:54:13 -0800
To: Marek Rouchal via RT <bug-MP3-Tag [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Sun, Mar 06, 2011 at 10:24:14AM -0500, Marek Rouchal via RT wrote: Show quoted text
> Sun Mar 06 10:24:13 2011: Request 66422 was acted upon. > Transaction: Ticket created by MAREKR > Queue: MP3-Tag > Subject: APIC not shown on certain devices/platforms > Broken in: 1.13 > Severity: Important > Owner: Nobody > Requestors: Marek.Rouchal@gmx.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=66422 > > > > I am about to develop a MP3 tagging software in Perl. Things are working > pretty well already, but I am facing an issue with embedded pictures: > after processing the ID3v2 tags with MP3::Tag, the embedded APICs don't > get displayed e.g. in the Windows 7 explorer, nor on e.g. my LG cell > phone - while other MP3s with APICs get displayed perfectly OK. I am at > the end of my wisdom - especially since MP3::Tag reads and write ALL of > these mp3s/ID3v2 tags and APICs OK. I tried various combinations of the > config tags (unsync, recalculate,...), removing the ID3v2 tag first, or > only editing the frames that changed - to no avail.
I think your testing is wrong. Force unsync, and try again from the start - not supporting `sync' is the standard bug in the readers.... If not, well, contact me again, and we will try to investigate it more... Try starting with having APIC only. Ilya
On Sun Mar 06 13:54:25 2011, nospam-abuse@ilyaz.org wrote: Show quoted text
> I think your testing is wrong. Force unsync, and try again from the > start - not supporting `sync' is the standard bug in the readers.... > > If not, well, contact me again, and we will try to investigate it > more... Try starting with having APIC only. > > Ilya
Thanks a lot Ilya for the quick reply and your suggestion. Actually, your analysis is quite right, I managed to update the ID3v2 tags properly now, by - setting MP3::Tag->config(id3v23_unsync => 0) - removing the entire ID3v2 tag - creating a new one - filling it with all information I have This way all devices I have show the attached pictures OK. I have a few follow-up questions though: - Is there a way to avoid complete removal and re-creation of the tag, but still use "sync" format? Seems that the update is quite high effort, at least for me it takes a lot of time to process an average MP3 file (4-5M in size). - How to most efficiently retrieve all existing ID3v2 tag information, store it in memory, and apply it to the newly re-created ID3v2 tag? - it seems that the unsync option is not compatible with id3v2_recalculate; it took me some time to realize that... maybe this should be documented? - what about IO::String filehandles? And/or using IO::String handles instead of temporary files within MP3::Tag? I noticed that reading/writing e.g. on a USB device or a network share takes quite a long time, and I was wondering whether I could read the MP3 file once into an IO::String object, pass that to MP3::Tag (which would process it fully in memory), and finally write the modified IO::String content back to a file? Thanks a lot, and keep up the good work! Cheers, Marek
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #66422] APIC not shown on certain devices/platforms
Date: Wed, 9 Mar 2011 10:27:26 -0800
To: Marek Rouchal via RT <bug-MP3-Tag [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Wed, Mar 09, 2011 at 06:21:05AM -0500, Marek Rouchal via RT wrote: Show quoted text
> - setting MP3::Tag->config(id3v23_unsync => 0) > - removing the entire ID3v2 tag > - creating a new one > - filling it with all information I have > This way all devices I have show the attached pictures OK.
I think it is documented for mp3info2. IIRC, -u -2 should force rewrite. Look in the section on encodings... Show quoted text
> - it seems that the unsync option is not compatible with > id3v2_recalculate; it took me some time to realize that... maybe this > should be documented?
Did not know it. Should not a proper fix be to fix it? ;-) Show quoted text
> - what about IO::String filehandles? And/or using IO::String handles > instead of temporary files within MP3::Tag?
There is no temporary files I know of. Show quoted text
> I noticed that > reading/writing e.g. on a USB device or a network share takes quite a > long time, and I was wondering whether I could read the MP3 file once > into an IO::String object, pass that to MP3::Tag (which would process it > fully in memory), and finally write the modified IO::String content back > to a file?
Why do you think it is going to be quickier than the current approach? Typically, a tag is very small. We read the tag into memory, modify it there, write tag back, (and, if needed, append the non-tag). Yours, Ilya
Subject: Re: [rt.cpan.org #66422] APIC not shown on certain devices/platforms
Date: Fri, 20 May 2011 15:49:58 +0100
To: bug-MP3-Tag [...] rt.cpan.org
From: Matthew Willson <matthew [...] playlouder.com>
Hi there I've also had problems parsing the APIC frames generated by MP3::Tag. After some investigation it appeared that the frame size in the APIC frame header was the size in bytes of the frame data *before* unsychronization, but the actual data in the frame has extra bytes added due to unsychronization, meaning that the tool I'm using gets confused when it tries to seek to the end of the frame data for that APIC tag. As far as I can tell from the spec, the size in the frame header should be inclusive of any extra bytes added for unsync, otherwise there's no way of skipping that frame without scanning through all the frame data counting the extra unsync bytes. Additionally, explicitly disabling id3v23_unsync didn't seem to change this behaviour. We still get the unsync encoding, at least for the data in the APIC frame. Don't know if this is related or not. Cheers -Matt
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #66422] APIC not shown on certain devices/platforms
Date: Fri, 20 May 2011 15:55:48 -0700
To: Matthew Willson via RT <bug-MP3-Tag [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Fri, May 20, 2011 at 10:50:09AM -0400, Matthew Willson via RT wrote: Show quoted text
> Queue: MP3-Tag > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=66422 > > > Hi there > > I've also had problems parsing the APIC frames generated by MP3::Tag. > > After some investigation it appeared that the frame size in the APIC frame header was the size in bytes of the frame data *before* unsychronization, but the actual data in the frame has extra bytes added due to unsychronization, meaning that the tool I'm using gets confused when it tries to seek to the end of the frame data for that APIC tag. As far as I can tell from the spec, the size in the frame header should be inclusive of any extra bytes added for unsync, otherwise there's no way of skipping that frame without scanning through all the frame data counting the extra unsync bytes. > > Additionally, explicitly disabling id3v23_unsync didn't seem to change this behaviour. We still get the unsync encoding, at least for the data in the APIC frame. Don't know if this is related or not.
This would be a MAJOR bug. I did not get any other report of this - and the relevant code is stable for years. If you can still reproduce this (with curent version), please send me the code. Or inspect with your tools what the documented EASY ways (like [untested] mp3info2 -F "APIC < filename.jpeg" foo.mp3 ) produce. Thanks, Ilya