title: PHP Imagick create GIF animation
body: <p>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?</p>
  
  <pre><code>// animation
  $animation = new Imagick();
  $animation-&gt;setFormat("GIF");
  
  // frames
  foreach($tmpJpegPath as $jpepPath) {
      $frame = new Imagick($jpepPath);
      $frame-&gt;thumbnailImage(176, 144);
      $animation-&gt;addImage($frame);
      $animation-&gt;setImageDelay(100);
      $animation-&gt;nextImage();
  }
  
  // save gif animation
  $animation-&gt;writeImages('./animation.gif', true);
  </code></pre>