Skip to content

Commit

Permalink
added patch to the video output format post processor function update…
Browse files Browse the repository at this point in the history
…FormatOptions that corrects the width and height dimensions of the final output if the input dimensions have been "fixed" from the aspect ratio data.
  • Loading branch information
buggedcom committed Apr 8, 2014
1 parent cf06d9c commit fb302e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PHPVideoToolkit/VideoFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,19 @@ public function updateFormatOptions(&$save_path)
{
parent::updateFormatOptions($save_path);

$video_data = $this->_media_object->readVideoComponent();

// check to see if the aspect ratio has fixed the width and heights, if so we must apply the size to any output.
if($video_data['dimensions']['aspect_ratio_fix_warning'] === true)
{
$this->setVideoDimensions($video_data['dimensions']['width'], $video_data['dimensions']['height']);
}

// if we have a rotation and it's set to true then we must autodetect the rotation according to the
// meta data available.
// !IMPORTANT that auto orientation is done before any automatic flipping.
if(empty($this->_format['video_rotation']) === false && $this->_format['video_rotation'] === true)
{
$video_data = $this->_media_object->readVideoComponent();
if(empty($video_data['rotation']) === false)
{
$current_rotation = (int) $video_data['rotation'];
Expand Down

0 comments on commit fb302e3

Please sign in to comment.