simple write removes image

Post Reply
sappster
User
Posts: 1
Joined: Thu Jun 26, 2014 2:06 pm
Are you a spambot?: no

simple write removes image

Post by sappster » Thu Jun 26, 2014 2:15 pm

I am using the code below (which is the simple write demo file). Everytime I run the script my image gets removed from the file. I have looked at the file from the browse page, and before I run the script I see the picture element inside the comments and inside id3v2->APIC->data.
After I run the script the entire APIC node is missing from the file. Can anyone provide guidance on how I can keep the image? My ultimate goal is to allow users to edit the ID3 information as well as replace the image with a new image, or create an image if non is present.

Code: Select all

require_once('../getid3/getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
$getID3->setOption(array('encoding'=>$TextEncoding));

require_once('../getid3/write.php');
// Initialize getID3 tag-writing module
$tagwriter = new getid3_writetags;
//$tagwriter->filename = '/path/to/file.mp3';
$tagwriter->filename = 'Merry Widow Waltz.mp3';

//$tagwriter->tagformats = array('id3v1', 'id3v2.3');
$tagwriter->tagformats = array('id3v2.3');

// set various options (optional)
// $tagwriter->overwrite_tags = true;
// $tagwriter->overwrite_tags = false;
$tagwriter->tag_encoding = $TextEncoding;
$tagwriter->remove_other_tags = false;

// populate data array
$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'),
);
$tagwriter->tag_data = $TagData;

James Heinrich
getID3() v1 developer
Posts: 1476
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: simple write removes image

Post by James Heinrich » Thu Jun 26, 2014 2:31 pm

Same issue as described in viewtopic.php?t=1828
Please read my first reply post in that thread, and continue discussion in that thread if applicable.

Post Reply