Error with demo.simple.write.php

Post Reply
mseifert
User
Posts: 2
Joined: Mon Nov 11, 2013 5:11 am
Are you a spambot?: no

Error with demo.simple.write.php

Post by mseifert » Mon Nov 11, 2013 5:31 am

I have downloaded getID3-1.9.7 and did the following:

1) Loaded demo.simple.write.php
2) Ran as is and got error:
Exception: $this->overwrite_tags=false is known to be buggy in this version of getID3. Will be fixed in the near future, check http://www.getid3.org for a newer version. in \path\to\getID3-1.9.7b\getid3\write.php on line 422
3) Commented out the line $tagwriter->overwrite_tags = false; (which leaves the line above which sets this to true)
4) Ran again and got:

Failed to write tags!
WriteID3v2() failed with message(s):
• [email] not specified for POPM
• Frame "POPM" is NOT allowed
• $this->GenerateID3v2FrameData() failed for "POPM"
• $this->GenerateID3v2Tag() failed

I have debugged the code and it appears that in the array:

Code: Select all

$TagData = array(
	'title'         => array('My Song'),
	'artist'        => array('The Artist'),
	'album'         => array('Greatest Hits'),
	'year'          => array('2004'),
	'genre'         => array('Rock'),
	'comment'       => array('excellent!'),
	'track'         => array('04/16'),
	'popularimeter' => array('email'=>'user@example.net', 'rating'=>128, 'data'=>0),
);

Code: Select all

popularimeter' => array('email'=>'user@example.net', 'rating'=>128, 'data'=>0)
is processed so that in write.php, source_data_array does not contain the valid array structure for 'POPM' and causes errors for both email and rating.

Through very crude hacks, I was able to fix it so it correctly writes the files. However, I don't know if it is in how demo.simple.write is passing the tags or in how the tag array is being processed.

Is there another write example that does it correctly?

Great code, just needs a small fix.

Separate topic (tell me if you want a separate post), but I can't find any guidance on how to write to the copyright field. Is this possible? Any guidance? Thanks for providing this.

mseifert
User
Posts: 2
Joined: Mon Nov 11, 2013 5:11 am
Are you a spambot?: no

Re: Error with demo.simple.write.php

Post by mseifert » Mon Nov 11, 2013 7:10 am

OK, so the easy fix for me is to not pass the popularimeter' array(). That way I can leave the code alone and I don't need the fields in it. I also figured out how to add copyright and url (url_user) information so all is good. Simple matter of adding it as so (for anyone looking in the future...)

Code: Select all

			$atags=array(
				"title"=>array($title),
				"artist"=>array($artist),
				"album"=>array($album),
				"year"=>array($year),
				"genre"=>array($genre),
				"comment"=>array($comment),
				"track"=>array($track),
				"copyright"=>array($copyright),
				"url_user"=>array($url),
				);

Post Reply