phpThumb
phpThumb copied to clipboard
Can't keep GIFs animated after compression
Hi, I'm unable to keep GIFs animated after compressing them although ImageMagick is already installed. Here is what I'm doing:
$phpThumb->resetObject();
$phpThumb->setSourceData(file_get_contents('mydir/'.date('Y',$up_ts).'/'.date('m',$up_ts).'/'.$up_old_name));
$output_filename = 'mydir/'.date('Y',$up_ts).'/'.date('m',$up_ts).'/'.$up_new_name;
$phpThumb->setParameter('q', $img_quality);
if($phpThumb->GenerateThumbnail()) {
if($phpThumb->RenderToFile($output_filename)) {
} else {
}
$phpThumb->purgeTempFiles();
} else {
}
I also have problem with creating animated gif thumbnails I compiled and used latest source of ImageMagick, but it did not help
Is it because phpThumb , uses
- PHP method
imagecreatefromgif()
?
which only supports reading 1st frame
https://github.com/JamesHeinrich/phpThumb/blob/master/phpthumb.class.php#L1642
https://www.php.net/manual/en/function.imagecreatefromgif.php
Yes i think its impossible with this library