From 3b564463052ed866524d68e10d528b3c4fc01562 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 17 Oct 2022 19:45:44 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20exif=20rotation=20(not=20orientation)=20?= =?UTF-8?q?=F0=9F=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Exif.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Exif.php b/lib/Exif.php index 51d0f510..599d1d36 100644 --- a/lib/Exif.php +++ b/lib/Exif.php @@ -323,8 +323,9 @@ class Exif { $height = $exif['ImageHeight'] ?? 0; // Check if image is rotated and we need to swap width and height - $rotation = $exif['Orientation'] ?? 0; - if (in_array($rotation, [5, 6, 7, 8])) { + $rotation = $exif['Rotation'] ?? 0; + $orientation = $exif['Orientation'] ?? 0; + if (in_array($orientation, [5, 6, 7, 8]) || in_array($rotation, [90, 270])) { return [$height, $width]; }