iksheth / php-reader

Automatically exported from code.google.com/p/php-reader
0 stars 0 forks source link

Bug in writing ID3v2.3.0 (version 4 works, but not version 3) #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This code seems to have a bug. When I attempt to modify an MP3 with an
ID3v2.3.0 tag, it corrupts the file such that it can no longer be played.
Here is the code I tried:
// ------------ code to reproduce the bug:
require_once("ID3v2.php");
$filename = 'STE-003.mp3'; 
echo "<pre>\n"; 
$newAlbum = "Test set Album again"; 
$id3 = new ID3v2($filename); 
$type = 'id3v2'; 
$title = $id3->tit2->text; 
$version = $id3->getHeader()->getVersion();
$album = $id3->talb->text;

echo "The $type version $version title of $filename is '$title' and the
album is '$album'\n";
$id3->talb->text = $newAlbum; 
echo "modifying the original file $filename to the album $newAlbum\n";
//$id3->getHeader()->setVersion(4.0);
$id3->write(); // with the new album name 
echo "</pre>\n";
// ---------------- end code

I set the ID3 tags on the file using audacity 1.2.6. The output of the test
run was:

The id3v2 version 3 title of STE-003.mp3 is 'title set in audacity' and the
album is 'album set in audacity' 
modifying the original file STE-003.mp3 to the album Test set Album again

If I set the version to 4.0 before the write() (see the commented out
line), the file remains playable, but my version of windows media player
(9.00.00.4530) does not see the tag.

I'd like to use this code, if it could read AND write version 3.0 correctly.

Thanks, David

Original issue reported on code.google.com by davidgai...@gmail.com on 28 Sep 2009 at 6:45

GoogleCodeExporter commented 8 years ago

Original comment by svollbehr on 20 Nov 2009 at 4:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Please try if you can reproduce the problem with the zend-branch code as well. 
If you
can, please include your test file URL as well.

Original comment by svollbehr on 20 Nov 2009 at 5:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Closed until problem can be reproduced

Original comment by svollbehr on 26 Mar 2010 at 6:51