修改生成视频变形的问题

This commit is contained in:
zyx0814
2024-02-06 23:16:10 +08:00
Unverified
parent d65bd880c6
commit 93733cd0c5

View File

@@ -84,10 +84,21 @@ class fmpeg
'width' => intval($meta->get('width')), 'width' => intval($meta->get('width')),
'height' => intval($meta->get('height')), 'height' => intval($meta->get('height')),
'duration' => round($meta->get('duration'), 2), 'duration' => round($meta->get('duration'), 2),
'tags' => $meta->get('tags'),
); );
} }
} }
if ($cachefile) @unlink($cachefile); if ($cachefile) @unlink($cachefile);
if(isset($info['tags']['rotate'])){
$rotate = intval($info['tags']['rotate'])%360;
if($rotate == 90){
$width = $info['width'];
$height = $info['height'];
$info['width'] = $height;
$info['height'] = $width;
}
}
unset($info['tags']);
return $info; return $info;
} }
@@ -316,6 +327,7 @@ class fmpeg
//获取视频信息 //获取视频信息
try { try {
$info = $this->getInfo($attachment); $info = $this->getInfo($attachment);
if(!in_array($ext,array('mp3','wav'))){ if(!in_array($ext,array('mp3','wav'))){
if($info['width']){ if($info['width']){
$width=$fwidth; $width=$fwidth;