2012-12-21 3 views
1

J'ai quelques fichiers JPEG et je veux créer une animation GIF avec eux. Cependant, ce code ne fonctionne pas. Pouvez-vous voir quel est le problème?PHP Imagick créer une animation GIF

// 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); 
+1

Bien sûr, le support jpeg est-il intégré? Comment cela ne fonctionne-t-il pas exactement? Les erreurs? – ficuscr

+0

@ficuscr si votre moyenne est $ jpepPath est un chemin pour mes fichiers jpeg. C'est vrai. – sweb

+0

problème résolu ... imagick doit être> = 3.1.0RC1 – sweb

Répondre

2

problème résolu ... imagick doit être> = 3.1.0RC1

+0

N'oubliez pas de cocher cette réponse ':)' – halfer

1

J'ai eu même problème avec le dernier paquet php5-imagick sur debian sifflante.

Ma solution:

pour que nous retirons paquet

apt-get remove php5-imagick 

cela est nécessaire pour l'étape suivante

apt-get install libmagickwand-dev 

installer imagick de PECL

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

done