Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function doTransform(MediaInterface $media)
 {
     parent::doTransform($media);
     if ($media->getBinaryContent()) {
         $image = $this->imagineAdapter->open($media->getBinaryContent()->getPathname());
         $size = $image->getSize();
         $media->setWidth($size->getWidth());
         $media->setHeight($size->getHeight());
         $media->setProviderStatus(MediaInterface::STATUS_OK);
     }
 }
Exemplo n.º 2
0
 /**
  * @param string                                           $name
  * @param \Gaufrette\Filesystem                            $filesystem
  * @param CDNInterface                                     $cdn
  * @param GeneratorInterface                               $pathGenerator
  * @param ThumbnailInterface                               $thumbnail
  * @param array                                            $allowedExtensions
  * @param array                                            $allowedMimeTypes
  */
 public function __construct($name, Filesystem $filesystem, CDNInterface $cdn, GeneratorInterface $pathGenerator, ThumbnailInterface $thumbnail, array $allowedExtensions = array(), array $allowedMimeTypes = array())
 {
     parent::__construct($name, $filesystem, $cdn, $pathGenerator, $thumbnail, $allowedExtensions, $allowedMimeTypes);
 }