Esempio n. 1
0
 /**
  * @return Image|\Imagine\Image\ImageInterface
  */
 private function card()
 {
     $this->imagine = new Imagine();
     $imagePath = $this->imagePath($this->addSuffix ? $this->layout->id() : null);
     if (!empty($this->cacheLifetime) && file_exists($imagePath) && time() - filemtime($imagePath) <= $this->cacheLifetime) {
         // cached card image
         return $this->imagine->open($imagePath);
     } else {
         // fresh card image
         return $this->drawLayout()->save($imagePath);
     }
 }