Skip to content

Commit fb302e3

Browse files
committed
added patch to the video output format post processor function updateFormatOptions that corrects the width and height dimensions of the final output if the input dimensions have been "fixed" from the aspect ratio data.
1 parent cf06d9c commit fb302e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/PHPVideoToolkit/VideoFormat.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,19 @@ public function updateFormatOptions(&$save_path)
111111
{
112112
parent::updateFormatOptions($save_path);
113113

114+
$video_data = $this->_media_object->readVideoComponent();
115+
116+
// check to see if the aspect ratio has fixed the width and heights, if so we must apply the size to any output.
117+
if($video_data['dimensions']['aspect_ratio_fix_warning'] === true)
118+
{
119+
$this->setVideoDimensions($video_data['dimensions']['width'], $video_data['dimensions']['height']);
120+
}
121+
114122
// if we have a rotation and it's set to true then we must autodetect the rotation according to the
115123
// meta data available.
116124
// !IMPORTANT that auto orientation is done before any automatic flipping.
117125
if(empty($this->_format['video_rotation']) === false && $this->_format['video_rotation'] === true)
118126
{
119-
$video_data = $this->_media_object->readVideoComponent();
120127
if(empty($video_data['rotation']) === false)
121128
{
122129
$current_rotation = (int) $video_data['rotation'];

0 commit comments

Comments
 (0)