Ignore images in tags

The place for "I can't figure out how to..." questions.
Post Reply
Posts: 16
Joined: Tue May 07, 2013 6:21 pm
Are you a spambot?: no

Ignore images in tags

Post by barryjarvis » Tue May 07, 2013 6:26 pm


I'm currently using getID3 as part of a WordPress plugin that streams mp3's from Amazon S3.

One issue i've noticed (which is specific to mobile devices) is the length of time it takes to start playing an mp3.
I've narrowed it down to the images embedded in the ID3 tags. If i remove images from the file it plays in a couple of seconds, with images though, it can take as long as 20 seconds to start playing.

What i don't want to do is have to delete the images from each file (we offer the ability to download as well as stream the mp3, so would like to keep the image for people who download).

So, my question really is, is it possible to ignore and NOT read the image within an ID3 tag?

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

Re: Ignore images in tags

Post by James Heinrich » Tue May 07, 2013 6:46 pm

Images are stored within the ID3v2 tag, which is at the beginning of the file. If you have an MP3 with no ID3v2, or a minimal ID3v2 tag (just basic text information) then you'll have only up to a few kB of non-audio data padding the beginning of the file. If you have large embedded images (or other tag contents, including padding) then you could potentially have several hundred (even thousand) kB of non-audio data at the start of the MP3 file, and it would need to be streamed first even though it doesn't contain any actual audio.

The only potential solution I can think of, assuming you can't split the images off into standalone files available on demand, is to move the embedded images from the ID3v2 tag at the beginning of the file to an APE tag (located at the end of the file). Unfortunately while ID3v2 support is nearly universal, APE tag support is pretty limited, I'd expect only a small portion of your listeners would even know that the file they downloaded contains embedded images in an APE tag. Offhand I'm not sure which playback software does support that.

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest