コード例 #1
0
 /**
  * @param Image $image
  *
  * @return ImagickCollection
  */
 public function preProcess(Image $image) : ImagickCollection
 {
     $this->imagick->readImage($image->storageLocation());
     $this->imagick->setFilename($image->filename());
     $collection = new ImagickCollection([$this->imagick]);
     foreach ($this->transformers as $transformer) {
         $transformer->applyTo($collection);
     }
     return $collection;
 }
コード例 #2
0
ファイル: ImageTest.php プロジェクト: hughgrigg/ching-shop
 /**
  * Should be able to get the image storage location.
  */
 public function testStorageLocation()
 {
     $image = new Image(['filename' => 'foo.jpg']);
     $this->assertInternalType('string', $image->storageLocation());
 }
コード例 #3
0
 /**
  * @param Image $imageResource
  *
  * @return SplFileObject
  */
 private function storageImageFile(Image $imageResource) : SplFileObject
 {
     try {
         return new SplFileObject($imageResource->storageLocation());
     } catch (\RuntimeException $e) {
         return new SplTempFileObject();
     }
 }