commit
8dfaf18158
3 changed files with 14 additions and 2 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
* 0.4.4 (12-17-2013)
|
||||||
|
|
||||||
|
* Fix width / height dimensions extraction.
|
||||||
|
|
||||||
* 0.4.3 (12-02-2013)
|
* 0.4.3 (12-02-2013)
|
||||||
|
|
||||||
* Fix using rotate and resize filters at the same time (#78)
|
* Fix using rotate and resize filters at the same time (#78)
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,9 @@ class Stream extends AbstractData
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $displayRatio && null !== $sampleRatio) {
|
if (null !== $displayRatio && null !== $sampleRatio) {
|
||||||
$width = round($width / $sampleRatio[0] * $sampleRatio[1] * $displayRatio[0] / $displayRatio[1]);
|
if ($sampleRatio[0] !== 1 && $sampleRatio[1] !== 1) {
|
||||||
|
$width = round($width / $sampleRatio[0] * $sampleRatio[1] * $displayRatio[0] / $displayRatio[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Dimension($width, $height);
|
return new Dimension($width, $height);
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,12 @@ class StreamTest extends TestCase
|
||||||
$this->assertEquals(new Dimension(1280, 720), $stream->getDimensions());
|
$this->assertEquals(new Dimension(1280, 720), $stream->getDimensions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetDimensionsFromVideoWith11SampleRatio()
|
||||||
|
{
|
||||||
|
$stream = new Stream(array('codec_type' => 'video', 'width' => 1920, 'height' => 1080, 'sample_aspect_ratio' => '1:1', 'display_aspect_ratio' => '16:9'));
|
||||||
|
$this->assertEquals(new Dimension(1920, 1080), $stream->getDimensions());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideInvalidRatios
|
* @dataProvider provideInvalidRatios
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue