Combine image scale and resize effects and add preserve aspect ratio option to scale

Created on 19 July 2009, about 15 years ago
Updated 13 February 2024, 7 months ago

Combines the Scale and Resize image effects into a single Scale effect with a checkbox for "Preserve aspect ratio" that defaults to checked. This is intended to simplify the image styles UI and make it more unified with what users have come to expect from applications like Photoshop and other image manipulation software.

This patch is dependent on #371374: Add ImageCache UI Core β†’ and is based off the discussion started by kika in that thread (link). I've separated it from that issue so that it doesn't get held up any longer than it has to and this is really just polish that is not absolutely necessary and because after working on it a bit I think it needs a bit more discussion regarding API changes.

The attached patch only modifies the UI aspect of things but it raises the question of wether or not we should change this in the API as well. Currently we have image_scale() and image_resize() functions. The image_scale() function resizes an image and maintains aspect ratio requiring only one dimension to be specified. The image_resize() function scales an image to an exact set of given dimensions.

Should we rewrite image_scale() with a maintain aspect ratio flag and get rid of image_resize() or should be leave it as is?

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
Image systemΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States eojthebrave Minneapolis, MN

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

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