wiztrust / php-reader

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

setImageData does not work #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

require_once 'Zend/Media/Id3v2.php';

$sourceMedia = "h.mp3";
$coverSourceImage = "untitled.jpg";

// Adds cover image
$id3 = new Zend_Media_Id3v2($sourceMedia);
include_once('Zend/Media/Id3/Frame/Apic.php');
$apic = new Zend_Media_Id3_Frame_Apic();
$apic->setEncoding(Zend_Media_Id3_Encoding::ISO88591);
$imageData = file_get_contents($coverSourceImage);
$apic->setImageData($imageData);
$apic->setMimeType('image/jpeg');
$apic->setImageType(3);

$id3->addFrame($apic);

$id3->write(null); 

this code does not work, the cover art of mp3 is not updated

Original issue reported on code.google.com by adminuji...@gmail.com on 21 Jan 2011 at 8:52

GoogleCodeExporter commented 9 years ago
Thanks for reporting the issue! This further confirms that there is an error 
with APIC frames and/or unsynchronization for ID3v2.3.

Original comment by svollbehr on 21 Jan 2011 at 9:32

GoogleCodeExporter commented 9 years ago
I have same bug 

Original comment by anastayb...@gmail.com on 2 May 2011 at 12:08

GoogleCodeExporter commented 9 years ago
Please try again with the latest code in subversion and report back if you 
still have some issues.

Original comment by svollbehr on 2 May 2011 at 3:01

GoogleCodeExporter commented 9 years ago
I have made further changes to subversion. It turns out that unsynchronization 
for ID3v2.3 is not quite supported by Windows operating systems. I have thus 
added a new option to the class called 'compat' which can be set to disable 
automatic unsynchronization. You can try this if it helps.

I will update the wiki pages accordingly.

Original comment by svollbehr on 2 May 2011 at 7:17