From 4f13ebfe3f34ad17742abd0f27dfe2202a3395c8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 23 May 2026 22:45:51 +0200 Subject: [PATCH] fix: apply EXIF orientation before resizing portrait images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Smartphone photos stored in landscape orientation with an EXIF rotation tag were being saved to S3 in the wrong orientation. Image.php read the raw pixel dimensions without first applying the EXIF tag, so portrait photos (e.g. 4032×3024 with Orientation=6) were classified and resized as landscape (1920×1080). Calling orient() immediately after read() physically rotates the image to match its EXIF orientation tag before any dimension checks or scaling. This ensures portrait photos remain portrait after processing. Intervention Image v3 reference: https://image.intervention.io/v3/modifying/orientation --- app/Util/Media/Image.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Util/Media/Image.php b/app/Util/Media/Image.php index 8fe72989c..1f96a1720 100644 --- a/app/Util/Media/Image.php +++ b/app/Util/Media/Image.php @@ -203,6 +203,7 @@ class Image } $img = $this->imageManager->read($fileContents); + $img = $img->orient(); $ratio = $this->getAspect($img->width(), $img->height(), $thumbnail); $aspect = $ratio['dimensions'];