Subject: | MP3::Tag can not create valid APIC frames. |
I was not able to make MP3::Tag create a tag with an APIC frame without modifying MP3::Tag sources. It seems that in MP3::Tag::ID3v2, in as_bin(), this line is the culprit:
$flags = chr(128) if $tag_data =~ s/\xFF(?=[\x00\xE0-\xFF])/\xFF\x00/g; # sync
If I comment that line out, then the problem goes away and I am able to create APIC frames that are valid and can be read by other programs. If I leave that line in, then the tags that MP3::Tag creates are corrupted and not readable by other programs (such as itunes, xmms, amarok etc).
I am not sure what that line is supposed to do, but it seems like the sequence of bytes it is looking for in that regex probably are matched in the image data that I am attaching, so its modifying the image data and that results in a corrupted tag.
For now I am just leaving that line commented out so that I can create valid APIC tags with MP3::Tag.
The way I am creating the tag btw is:
$id3v2->add_frame('APIC', chr(0x0), $mime_type, chr(0x0), '', $im_data);
It would be nice if this could be fixed so that MP3::Tag could attach cover art.
If you need any additional information, please let me know.
Regards,
Michael Schout