mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix incorrect aspect ratio after converting a vertical video
https://xetown.com/questions/1775808
This commit is contained in:
parent
2cb476dc37
commit
10123a86a8
1 changed files with 11 additions and 3 deletions
|
|
@ -1303,9 +1303,17 @@ class FileController extends File
|
|||
}
|
||||
|
||||
// Get video size and duration
|
||||
$file_info['width'] = (int)$stream_info['video']['width'];
|
||||
$file_info['height'] = (int)$stream_info['video']['height'];
|
||||
$file_info['duration'] = (int)$stream_info['video']['duration'];
|
||||
if (isset($stream_info['video']['tags']['rotate']) && in_array($stream_info['video']['tags']['rotate'], [90, 270]))
|
||||
{
|
||||
$file_info['width'] = (int)$stream_info['video']['height'];
|
||||
$file_info['height'] = (int)$stream_info['video']['width'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$file_info['width'] = (int)$stream_info['video']['width'];
|
||||
$file_info['height'] = (int)$stream_info['video']['height'];
|
||||
}
|
||||
$file_info['duration'] = round($stream_info['video']['duration']);
|
||||
$adjusted = [
|
||||
'width' => $file_info['width'],
|
||||
'height' => $file_info['height'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue