auto-orient needs to (conditionally) change dimensions

Created on 8 April 2013, about 12 years ago
Updated 20 January 2025, 5 months ago

Hate to file an issue against my own code, but related to 🐛 Rotate should alter dimensions Closed: outdated auto-orient has the same problem, but worse, because whether or not the image will be rotated is not known until the auto orient is executed.

In particular I think this is really only a problem for "scale and crop" because the core scale and crop manipulates the (possibly incorrect) image height and width and calls "scale" and "crop" individually.

I believe the "clean" way to fix this is to have drupal core not have "inside knowledge" of how the image toolkits work, but simply delegate the operations to the image toolkits. That means that image_scale_and_crop() would call the image toolkits' scale_and_crop(). The gd version would be the code now in image_scale_and_crop() and the imagemagic version would do something like

-resize 'widthxheight^' -crop widthxheight

which does the appropriate thing regardless of rotation.

Does this make sense?

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇺🇸United States mikel1

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