From 14f54e9df44d0e6d79059044e811b121412ca89a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 17 Nov 2024 23:59:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96iOS=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=A0=E5=80=92=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Module/Base.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Module/Base.php b/app/Module/Base.php index d640eab65..9c61499bb 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -2063,13 +2063,18 @@ class Base $exif = @exif_read_data($array['file']); if (!empty($exif['Orientation'])) { $data = match ($exif['Orientation']) { - 8 => imagerotate($data, 90, 0), + 2 => imageflip($data, IMG_FLIP_HORIZONTAL), 3 => imagerotate($data, 180, 0), + 4 => imageflip($data, IMG_FLIP_VERTICAL), + 5 => imageflip(imagerotate($data, -90, 0), IMG_FLIP_HORIZONTAL), 6 => imagerotate($data, -90, 0), + 7 => imageflip(imagerotate($data, 90, 0), IMG_FLIP_HORIZONTAL), + 8 => imagerotate($data, 90, 0), default => null, }; if ($data !== null) { imagejpeg($data, $array['file']); + imagedestroy($data); } } }