I am looking for the best or any way to set the Album Art of mp3s using PHP.
Suggestions?
I am looking for the best or any way to set the Album Art of mp3s using PHP.
Suggestions?
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:
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
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.
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.