/** * @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; }
/** * @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; }
/** * @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()); }