1

I wants to resize animated GIF images without loosing animation. Resize process is working fine but after resize animation goes away. Please check my script in-line if i am doing anything wrong

Version: ImageMagick 6.9.1-1 PECL Imagick Extension - 3.1.2

$images = $this->imageObj->coalesceImages();
foreach ($images as $frame) {
 $frame->thumbnailImage($this->thumbWidth, $this->thumbHeight);
 $frame->setImagePage($this->thumbWidth, $this->thumbHeight, 0, 0);
}

$this->imageObj = $images->deconstructImages();
$this->imageObj->writeImage($this->thumbImagePath);
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
coder
  • 283
  • 4
  • 26
  • possible duplicate of [Resize animated GIF file without destroying animation](http://stackoverflow.com/questions/718491/resize-animated-gif-file-without-destroying-animation) – Jonas Czech Apr 10 '15 at 12:34
  • also http://askubuntu.com/questions/257831/how-can-i-resize-an-animated-gif-file-using-imagemagick – Jonas Czech Apr 10 '15 at 12:34

1 Answers1

0

See this answer. From the link:

If you have imagemagick access, you can do this:

system("convert big.gif -coalesce coalesce.gif");
system("convert -size 200x100 coalesce.gif -resize 200x10 small.gif");
Community
  • 1
  • 1
Jonas Czech
  • 12,018
  • 6
  • 44
  • 65
  • 1
    Hi I gone through all provided links before posting my question. I only wants to do it through PHP ImagicK pecl extension. I also tried writeImage with file_put_contents but it also does not helped. – coder Apr 13 '15 at 07:14
  • @user524694, in the link i posted there is another way to do it. – Jonas Czech Apr 13 '15 at 07:23
  • Hi, I am able to resize animated GIF image now but when i stream same image with Imagick it renders image but animation lost and when i print same image with file_put_contents it renders image without loosing animation. – coder Apr 13 '15 at 12:33
  • Hi may i know performance , resource utilization between streaming image using Imagick and readfile. – coder Apr 13 '15 at 13:00
  • @user524694, I don't know. – Jonas Czech Apr 13 '15 at 15:52