/** * @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; }
/** * Should be able to get the image storage location. */ public function testStorageLocation() { $image = new Image(['filename' => 'foo.jpg']); $this->assertInternalType('string', $image->storageLocation()); }
/** * @param Image $imageResource * * @return SplFileObject */ private function storageImageFile(Image $imageResource) : SplFileObject { try { return new SplFileObject($imageResource->storageLocation()); } catch (\RuntimeException $e) { return new SplTempFileObject(); } }