Exemplo n.º 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;
 }
Exemplo n.º 2
0
 /**
  * Tests generate filename
  */
 public function testGenerateFileName()
 {
     $filename = $this->fileManager->generate($this->filesystemAdapter, 'png', $this->rootPath);
     static::assertInternalType('string', $filename);
 }