replace cover art

Post Reply
yasuo
User
Posts: 4
Joined: Sun Oct 02, 2016 1:27 pm
Are you a spambot?: no

replace cover art

Post by yasuo » Sun Oct 02, 2016 1:41 pm

Hi there,

i found out one way to excract cover art:

Code: Select all

require_once("getid3/getid3/getid3.php");
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($mp3_out);
//$img_old_bin=$ThisFileInfo['id3v2']['APIC'][0]['data'];
$img_old_bin=$ThisFileInfo['comments']['picture'][0]['data'];
i also found about writing tags including cover arts.
my next step was to modify the image and save the changes to the original array:

Code: Select all

$ThisFileInfo['id3v2']['APIC'][0]['data']               =$img_new_bin;
$ThisFileInfo['id3v2']['APIC'][0]['datalength']         =strlen($img_new_bin);
$ThisFileInfo['comments']['picture'][0]['data']         =$img_new_bin;
$ThisFileInfo['comments']['picture'][0]['datalength']   =strlen($img_new_bin);
now i just want to replay the modified tags and not recreate everything new.

whats the easiest way to
1. read all tags,
2. modify single tags
3. rewrite all tags
?

Greetings :-)

Post Reply