How to crop only when it would make image smaller?

Created on 23 September 2011, over 13 years ago
Updated 11 June 2025, 2 days ago

Sorry that I can't seem to figure this out, but I'm trying to take an image of arbitrary size and fit it inside a rectangle that is 280 pixels wide and an arbitrary height no greater than 280 pixels tall.

Resize: width 280 does a great job, but sometimes I have portrait-orientation images that end up taking too much space.

So I tried using "crop" thinking that would be the natural effect to do this job. If the image would be greater than 280 pixels tall, it works great. If the image would be smaller than 280 pixels tall it adds black background to the top and the bottom of the image to make it 280 pixels tall.

Is there any way to crop without the possibility of making the image larger than it was before? The "Scale" effect has an option to allow upscaling—I'd like to see the "Crop" effect have an option to allow NOT upsizing—actually, I think not upsizing should be the default, but that's a topic for another day. Today I'd just like to know how to do it..

💬 Support request
Status

Closed: outdated

Component

Styles UI

Created by

🇺🇸United States smscotten

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

Comments & Activities

  • 🇺🇸United States bluegeek9

    Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.

Production build 0.71.5 2024