Example #1
0
 /**
  * Process sizes
  *
  * @param string $file File data
  * @param string $fileName File name
  * @param string $context File context
  * @param string $extension File extension
  * @param FilesystemAdapter $filesystemAdapter
  *
  * @return Processor
  */
 public function processSizes($file, $fileName, $context, $extension, FilesystemAdapter $filesystemAdapter)
 {
     foreach ($this->config[$context] as $sizeName => $values) {
         $image = $this->openImageHandler->loadImage($file);
         $operation = $this->manipulatorFactory->create($values['operation']);
         $image = $operation->manipulate($image, $values['width'], $values['height']);
         $this->fileManager->setFileSystemAdapter($filesystemAdapter)->uploadFile($image, $extension, $context, $sizeName, $fileName);
     }
     return $this;
 }
Example #2
0
 public function testOpenImageWithWrongImageLibraryName()
 {
     static::setExpectedExceptionRegExp('Todstoychev\\Icr\\Exception\\IcrRuntimeException');
     $this->openImageHandler->setImageLibrary('test');
     $this->openImageHandler->openImage($this->path);
 }