PIC versus APIC in id3v2

Locked
allen
User
Posts:2
Joined:Wed Jul 30, 2014 10:41 pm
Are you a spambot?:no
PIC versus APIC in id3v2

Post by allen » Wed Jul 30, 2014 11:04 pm

It would seem I have some mp3 files that have an earlier, maybe beta or proprietary version of id3v2. I find that some contain the frame id PIC for the cover art while others it is APIC. My questions...

Is there a way to get the info whether the id is PIC or APIC? If I change APIC to PIC it will get the data from the early id3v2 mp3 files. I tried using a wildcard with no success. Currently using the following function...
file_put_contents('cover.jpg', $getID3->info['id3v2']['APIC'][0]['data']);

If not is there an mp3 utility that batch updates early id3v2 to the current standard?

Thank you so much for your time,
Allen

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: PIC versus APIC in id3v2

Post by James Heinrich » Wed Jul 30, 2014 11:20 pm

'PIC' is used in ID3v2.2 (original published version of the ID3v2 standard). It was soon replaced with ID3v2.3 which is by far the most common version. A later update to ID3v2.4 is less-commonly used, and is a relatively minor change from 2.3.

For the end user there's little difference between any of the versions, and getID3 strives to make it relatively transparent. I would strongly suggest not accessing any specific frame data inside the [id3v2] (or any other tag format) keys, but rather look in the aggregated [comments] key, or in [tags] (e.g. [tags][id3v2]) if you need something explicitly from one tag format or another. Instead of looking at [id3v2][APIC], look at [comments][picture] -- this will contain all the images from ID3v2, APE, or whatever tagging scheme is used on that particular file, no matter what file format it is, you can always find the data in the same place.

allen
User
Posts:2
Joined:Wed Jul 30, 2014 10:41 pm
Are you a spambot?:no

Re: PIC versus APIC in id3v2

Post by allen » Thu Jul 31, 2014 12:57 pm

Thank you James for the awesome script(s) and taking your time to answer my question. My research has shown all the mp3's with PIC are encoded by iTunes, versions ranging from 7.x thru 10.x. I would assume or hope they have updated to the standard ID3v2.3.

I had temporarily edited my script to look for APIC and if filesize = 0 bytes ran the function again looking for PIC. Per your instructions I will edit my script to look at [comments][picture].

I'd like to mention your script has taught me a lot about frame data.. information I never knew before using getID3.

Again, thank you,
Allen

Locked