How change cover of mp3 file ?

Post Reply
AWD
User
Posts: 3
Joined: Wed Aug 06, 2014 4:03 pm
Are you a spambot?: no

How change cover of mp3 file ?

Post by AWD » Wed Aug 06, 2014 4:06 pm

Hi
How use getID3 and change cover of mp3 file ?
Thx

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: How change cover of mp3 file ?

Post by James Heinrich » Thu Aug 07, 2014 2:03 pm

Basically:
  1. read existing tag data
  2. store contents of $returneddata['tags']['id3v2'] into a variable as the data you want to write back
  3. modify the above contents as you want (updating any tag values, including adding/removing any attached pictures
  4. write data back to MP3 file
Be warned: the API for tag writing was never finished, therefore the tag writing process is complex and non-intuitive. There have also been reports that tags read and written by both getID3 and Windows Media Player may lead to corruption, for reasons as-yet unknown. Use tag-writing functions at your own risk.

For writing tags take a look at the two supplied writing demos included with the getID3 distribution. For attached pictures specifically, see lines 69-101 of demo.write.php.

AWD
User
Posts: 3
Joined: Wed Aug 06, 2014 4:03 pm
Are you a spambot?: no

Re: How change cover of mp3 file ?

Post by AWD » Thu Aug 07, 2014 4:47 pm

Thx
Can you give me the code ?
Thank you

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: How change cover of mp3 file ?

Post by James Heinrich » Thu Aug 07, 2014 5:12 pm

All the code examples you need are found in demo.write.php and demo.simple.write.php

AWD
User
Posts: 3
Joined: Wed Aug 06, 2014 4:03 pm
Are you a spambot?: no

Re: How change cover of mp3 file ?

Post by AWD » Thu Aug 07, 2014 6:49 pm

I not found it !

Post Reply