Subject: | Incorrect templates to pack |
The file I am using says v1.21 at the top (downloaded it tonight, so it should be the newest).
I believe some of the templates to pack are incorrect when using Z*... In particular, the one that brought the error to my attention was found in the APIC frame. Using a hex editor and comparing the results of adding an image via MPEG::ID3v2Tag vs iTunes for Windows, I noticed two additional null bytes in the output from MPEG::ID3v2Tag (iTunes was also unable to properly read the image from the MP3... I just got a big empty box); specifically, the erroneous null bytes appeared after the Mime-type, and after the description.
Turns out, the data_as_string sub packs using the following template: "CZ*x" twice... this should be "CZ*" as Z* will automatically append a null character. This explains the additional 2 null characters. A quick scan of the code shows Z*x in one other location for the Text frames, though, those appear to work anyway... probably because extra null byte paddings are ignored? The frame length would tell the parser (like iTunes) where to find the next frame anyway, so the extra null byte at the end of the frame wouldn't cause any problems, just take up a little more space. However, in the case of the APIC, the extra null bytes make it unreadable since it offsets the beginning of the image data by 2 bytes.
In any event, its been a while since I've done some serious Perl coding, so I hope my comments are helpful!
-Bob