From 93733cd0c5cd5b3774efd84aab1b05b73c3cca96 Mon Sep 17 00:00:00 2001 From: zyx0814 Date: Tue, 6 Feb 2024 23:16:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=8F=98=E5=BD=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dzz/ffmpeg/class/class_fmpeg.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dzz/ffmpeg/class/class_fmpeg.php b/dzz/ffmpeg/class/class_fmpeg.php index 31913af..8052ca0 100644 --- a/dzz/ffmpeg/class/class_fmpeg.php +++ b/dzz/ffmpeg/class/class_fmpeg.php @@ -84,10 +84,21 @@ class fmpeg 'width' => intval($meta->get('width')), 'height' => intval($meta->get('height')), 'duration' => round($meta->get('duration'), 2), + 'tags' => $meta->get('tags'), ); } } 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; } @@ -316,6 +327,7 @@ class fmpeg //获取视频信息 try { $info = $this->getInfo($attachment); + if(!in_array($ext,array('mp3','wav'))){ if($info['width']){ $width=$fwidth;