PHP Imagick create GIF animation

I have some JPEG files and I want to create a GIF animation with them. However this code doesn't work. Can you see what the problem is?

// animation
$animation = new Imagick();
$animation->setFormat("GIF");

// frames
foreach($tmpJpegPath as $jpepPath) {
    $frame = new Imagick($jpepPath);
    $frame->thumbnailImage(176, 144);
    $animation->addImage($frame);
    $animation->setImageDelay(100);
    $animation->nextImage();
}

// save gif animation
$animation->writeImages('./animation.gif', true);

Upvotes: 0

Views: 2838

Answers (2)

RAD-X
RAD-X

Reputation: 46

I had same issue with latest php5-imagick package on debian wheezy.

My solution:

for sure we remove package

apt-get remove php5-imagick

this is needed for next step

apt-get install libmagickwand-dev

install imagick from pecl

pecl install imagick
echo "extension=imagick.so" >> /path/to/your/php.ini

done

Upvotes: 1

problem solved ... imagick must be >= 3.1.0RC1

Upvotes: 2

Related Questions