Ejemplo n.º 1
0
 /**
  * @param array $fileData
  *
  * @return bool
  */
 private function resizeImage(array $fileData)
 {
     if (array_key_exists($fileData['type'], $this->mimeTypes)) {
         $fileManager = $this->getFileManager();
         return $this->thumbnailer->resizeOrigImage($fileData['tmp_name'], $fileManager->getOrigDir(), $fileManager->getThumbDir());
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * @covers DmFileman\Service\Thumbnailer\Thumbnailer
  */
 public function testResizeOrigImageReturnsTrueIfGetimagesizeIsSuccessful()
 {
     $origName = vfs\vfsStream::url('root/orig/white.gif');
     $origDir = vfs\vfsStream::url('root/orig');
     $thumbDir = vfs\vfsStream::url('root/thumb');
     $this->sut->setThumbConfig([Thumbnailer::CONFIG_WIDTH => 10000, Thumbnailer::CONFIG_HEIGHT => 10000]);
     $actualResult = $this->sut->resizeOrigImage($origName, $origDir, $thumbDir);
     $this->assertTrue($actualResult);
 }