Image Upload: Orientation Changes When Scaling Down

Created on 22 July 2025, about 2 months ago
Updated 4 August 2025, about 1 month ago

Problem/Motivation

When uploading a profile picture to drupal.org, images exceeding the 1024x1024 pixel dimension limit are scaled down as expected. However, this scaling process appears to be introducing an unintended side effect: a change in image orientation.

Steps to reproduce

1. Navigate to your user profile edit page on drupal.org.

2. Attempt to upload a image with dimensions greater than 1024x1024 pixels (e.g., 3648x5472 pixels).

3. Save the profile.

Expected behavior:

The uploaded image should be scaled down to fit within the 1024x1024 pixel limit while preserving its original orientation.

Actual behavior:

The uploaded image is scaled down, but its orientation is incorrectly changed.

Further observations:

To confirm that the issue is related to drupal.org's scaling mechanism and not the image itself or initial dimensions, I pre-rescaled the same image to 683x1024 pixels using an external tool (Adobe Express). When this pre-rescaled image was uploaded, its orientation was correctly preserved.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇺🇸United States drumm NY, US

    This isn’t something I’ve seen before, so I suspect the image could have some more-modern type of encoding that has the rotation as something like metadata, that our admittedly old infrastructure might not handle well.

    We use Drupal core’s user pictures and image styles for resizing, so there is some chance that this is a general Drupal issue. It would be good to test the same image on a fresh install of Drupal.

    We are upgrading our site in the coming months, so I expect that to resolve this issue, if it is due to outdated image libraries. Regardless, the same image that got rotated will be needed to test this, since it isn’t reproducible with a simple oversized image.

Production build 0.71.5 2024