コード例 #1
0
ファイル: Video.php プロジェクト: alchemy-fr/MediaVorus
 /**
  * @VirtualProperty
  *
  * @return Integer
  */
 public function getHeight()
 {
     $height = parent::getHeight();
     if (null === $this->ffprobe) {
         return $height;
     }
     try {
         $video = $this->ffprobe->streams($this->file->getPathname())->videos()->first();
         return $video->getDimensions()->getHeight();
     } catch (FFMpegException $e) {
     }
     return $height;
 }
コード例 #2
0
ファイル: Video.php プロジェクト: ilosada/chamilo-lms-icpna
 /**
  * @VirtualProperty
  *
  * @return Integer
  */
 public function getHeight()
 {
     if (null !== ($result = parent::getHeight())) {
         return $result;
     }
     if (null === $this->ffprobe) {
         return null;
     }
     try {
         $video = $this->ffprobe->streams($this->file->getPathname())->videos()->first();
         if ($video->has('height')) {
             return (int) $video->get('height');
         }
     } catch (FFMpegException $e) {
     }
     return null;
 }
コード例 #3
0
 /**
  * @covers \MediaVorus\Media\Image::getColorSpace
  */
 public function testGetColorSpace()
 {
     $file = __DIR__ . '/../../../files/ExifTool.jpg';
     $media = new Image(new File($file), $this->reader->reset()->files($file)->first(), $this->writer);
     $this->assertEquals(Image::COLORSPACE_RGB, $media->getColorSpace());
     $file = __DIR__ . '/../../../files/GRAYSCALE.jpg';
     $media = new Image(new File($file), $this->reader->reset()->files($file)->first(), $this->writer);
     $this->assertEquals(Image::COLORSPACE_GRAYSCALE, $media->getColorSpace());
     $file = __DIR__ . '/../../../files/RVB.jpg';
     $media = new Image(new File($file), $this->reader->reset()->files($file)->first(), $this->writer);
     $this->assertEquals(Image::COLORSPACE_RGB, $media->getColorSpace());
 }