From 4183d9eec460ce6ea0052518e065ca81ae7a36a2 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 10 Jun 2014 11:39:00 +0200 Subject: [PATCH 1/2] Fix width & height video extraction to take aspect ratio into account --- src/MediaVorus/Media/Video.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/MediaVorus/Media/Video.php b/src/MediaVorus/Media/Video.php index 79ba1ba..41939b9 100644 --- a/src/MediaVorus/Media/Video.php +++ b/src/MediaVorus/Media/Video.php @@ -45,12 +45,10 @@ public function getType() */ public function getWidth() { - if (null !== $result = parent::getWidth()) { - return $result; - } + $width = parent::getWidth(); if (null === $this->ffprobe) { - return null; + return $width; } try { @@ -58,14 +56,13 @@ public function getWidth() ->streams($this->file->getPathname()) ->videos() ->first(); - if ($video->has('width')) { - return (int) $video->get('width'); - } + + return $video->getDimensions()->getWidth(); } catch (FFMpegException $e) { } - return null; + return $width; } /** @@ -75,12 +72,10 @@ public function getWidth() */ public function getHeight() { - if (null !== $result = parent::getHeight()) { - return $result; - } + $height = parent::getHeight(); if (null === $this->ffprobe) { - return null; + return $height; } try { @@ -88,14 +83,13 @@ public function getHeight() ->streams($this->file->getPathname()) ->videos() ->first(); - if ($video->has('height')) { - return (int) $video->get('height'); - } + + return $video->getDimensions()->getHeight(); } catch (FFMpegException $e) { } - return null; + return $height; } /** From f365fe2c278b55ea7cc9b0128dc5a875105a8f2a Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 26 Aug 2014 14:30:03 +0200 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d867c..146bdb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,23 @@ CHANGELOG --------- +* 0.4.4 (08-26-2014) + + * Fix width & height video extraction (@nlegoff). + +* 0.4.3 (01-06-2014) + + * Fix audio sample rate cast. + +* 0.4.2 (11-28-2013) + + * Add support for video orientation. + +* 0.4.1 (10-21-2013) + + * Add compatibility with PHP-FFmpeg 0.4. + * Fix temporary files management. + * 0.4.0 (07-04-2013) * Add compatibility with PHP-FFMpeg 0.3.