Omar Abdel-Wahab - 2009-08-18 11:57:33
Hello there and thank you for the immense effort you put and the amazing class.
I was using your GIFEncoder to merge GIF slides extracted from an animated GIF decoded by your nice GIFDecoder. The idea is to watermark an animated GIF. This process seemed to result in damaging my GIF files.
Any ideas what I am missing here?
==================================
<?php
// Decode the old GIF file
$gifDecoder = new GIFDecoder(fread(fopen($image, "rb"), filesize($image)));
// Merge all frames
$gifEncoder = new GIFEncoder($gifDecoder->GIFGetFrames(),
$gifDecoder->GIFGetDelays(),
$gifDecoder->GIFGetLoop(),
$gifDecoder->GIFGetDisposal(),
$gifDecoder->GIFGetTransparentR(),
$gifDecoder->GIFGetTransparentG(),
$gifDecoder->GIFGetTransparentB(),
'bin');
// Cache the generated image
fwrite(fopen('newimage.gif', "wb"), $gifEncoder->GetAnimation());
// Result: an animated GIF that has lots of details lost in all frames except the first frame
?>
===================================
Thanks again.