Can't write genre or comment to id3v2

The place for "I can't figure out how to..." questions.
Post Reply
autonic
User
Posts: 3
Joined: Fri Oct 06, 2006 7:25 pm

Can't write genre or comment to id3v2

Post by autonic » Wed Aug 22, 2007 2:58 am

Im using the following chunk of code to write my id3 tags:

Code: Select all

		$getID3 		= new getID3;
		$TaggingFormat 	= 'UTF-8';
		$getID3->setOption(array('encoding'=>$TaggingFormat));
		require_once('inc/getid3/write.php');
		$tagwriter = new getid3_writetags;
		$tagwriter->filename       = $filepath;
		$tagwriter->tagformats     = array('id3v1', 'id3v2.3');
		$tagwriter->overwrite_tags = true;
		$tagwriter->tag_encoding   = $TaggingFormat;
		$tagwriter->remove_other_tags = false;
		$TagData['title'][]   	= $title;
		$TagData['artist'][]  	= $artist;
		$TagData['album'][]  	= $album;
		$TagData['genre'][]   	= $genre;
		$TagData['year'][]   	= $year;
		$TagData['comment'][]  	= $version;
		$tagwriter->tag_data 	= $TagData;
		$tagwriter->WriteTags();
It works fine on ID3v1, but not as good on ID3v2.
It writes all the fields on the id3v1-tag, but on the id3v2 it skips the genre and comment-tags. No warnings or anything.

I've tried the 2.x version of the source code, but that just gives me strange errors (For instance: after an attempt to write a id3v2 tag with the 2.x source code, the tagger removes the last char from both the artist and the year-field), so I've given up on the 2.x, since the 1.7.x has worked flawless for me (except this problem of course)

If anyone could point me in the right direction, I would be happy.

Post Reply