tags:

views:

507

answers:

5

I am looking for the best or any way to set the Album Art of mp3s using PHP.

Suggestions?

A: 

I don't think it's really possible with PHP. I mean, I suppose anything is possible but it may not be a native PHP solution. From the PHP Docs, I think the only items that can be updated are:

  • Title
  • Artists
  • Album
  • Year
  • Genre
  • Comment
  • Track

Sorry man. Maybe Perl, Python, or Ruby might have some solution.

I'm not sure if you are familiar with Perl (I personally don't like it, but, it's good at things like this...). Here's a script that seems to be able to pull in and edit album art in an MP3: http://www.plunder.com/-download-66279.htm

KyleFarris
A: 

You can look into the getID3() project. I can't promise that it can handle images but it does claim to be able to write ID3 tags for MP3s so I think it will be your best bet.

MitMaro
+1  A: 

Album art is a data frame identified as “Attached picture” due ID3v2 specification, and getID3() now is only one way to write all possible data frames in ID3v2 with pure PHP.

Look at this source: http://getid3.sourceforge.net/source/write.id3v2.phps

Search for this text in the source:

// 4.14  APIC Attached picture

there's a piece of code responsible for writing album art.

Another way, that seems to be not as slow as pure PHP, is to use some external application, that will be launched by PHP script. If your service designed to work under a high load, binary compiled tool will be a better solution.

Sergey 'm17' Kolosov
A: 

Not sure this is still an issue but:

the amazingly complete getid3() (http://getid3.org) project will solve all your problems. Check out this forum post for more info.

opbot