Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function animate(array $frames, $delay = 20)
 {
     $gif = new \Imagick();
     $gif->setFormat('gif');
     foreach ($frames as $im) {
         if ($im instanceof Imanee) {
             $frame = $im->getResource()->getResource();
         } else {
             $frame = new \Imagick($im);
         }
         $frame->setImageDelay($delay);
         $gif->addImage($frame);
     }
     $imagickResource = new ImagickResource();
     $imagickResource->setResource($gif);
     $imanee = new Imanee();
     $imanee->setResource($imagickResource);
     $imanee->setFormat('gif');
     return $imanee;
 }
Beispiel #2
0
 /**
  * @expectedException Imanee\Exception\UnsupportedMethodException
  */
 public function testAnimateShouldThrowExceptionIfNotSupported()
 {
     $dummy = $this->getMock('Imanee\\Model\\ImageResourceInterface');
     $this->model->setResource($dummy);
     $this->model->animate();
 }