Adjust Rectangle class to calculate rotated image dimensions according to libgd 2.2.2+

Created on 5 November 2017, over 7 years ago
Updated 21 March 2025, 16 days ago

Problem/Motivation

PHP bugfix https://github.com/php/php-src/commit/22c487616f132ee7ebfa838bce9d14c924... has changed the logic to calculate image dimensions for rotated images, causing Drupal's critical #2918570: Drupal\KernelTests\Core\Image\ToolkitGdTest fails on PHP 7.1.x-dev and 7.0.x-dev following a PHP bugfix โ†’ .

See also:
libgd fix - https://github.com/libgd/libgd/issues/225

Proposed resolution

Fix the Rectangle class to adapt the same calculation logic as GD in libgd 2.2.2 and above. This way images rotated in Drupal will always take the same dimensions, regardless of the libgd library actually linked to the PHP instance in use.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

๐Ÿ“Œ Task
Status

Postponed: needs info

Version

11.0 ๐Ÿ”ฅ

Component

base system

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

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.

Production build 0.71.5 2024