コード例 #1
0
ファイル: ImageProvider.php プロジェクト: geoffreytran/zym
 /**
  * {@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);
     }
 }
コード例 #2
0
ファイル: AudioProvider.php プロジェクト: geoffreytran/zym
 /**
  * @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);
 }