Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Image Scale and Crop Without Upscale

Security covered Maintenance fixes only 241 sites

This module provides an image effect that scales and crops images to a specified size without upscaling. If the source image is smaller than the target dimensions, the target dimensions are scaled down to prevent pixelation and loss of quality, while still maintaining the aspect ratio. This ensures that the output image resolution is never larger than the original.

Drupal core provides and image effect called "Scale and Crop". This effect asks for a target width and height. The source image is scaled up or down to fit within those dimensions (respecting the aspect ratio), and the crops out the remaining portion.

In most cases, it doesn't make sense to upscale the image to fit, because upscaling will result in pixelation and loss of quality.

Drupal core has a longstanding issue to have this fixed, but until then, this module exists to provide the functionality.

This image effect provided by this module while check if the source image width and/or height are smaller than the target dimensions. If so, instead of scaling the image up, the target dimensions are scaled down. This means the output image resolution will be smaller than desired, but the aspect ratio of the target resolution is still maintained, and no upscaling of the image occurs.

Source Resolution Target Resolution Result from Scale and Crop (from core) Result from Scale and Crop (this module) 200x200 (1:1) 300x200 (3:2) 300x200 (3:2, scaled up) 200x133 (3:2) 300x300 (1:1) 300x200 (3:2) 300x200 (3:2) 300x200 (3:2) 300x400 (3:4) 400x225 (16:9) 400x225 (16:9, scaled up) 300x169 (16:9)
Drupal 9–11

Ask your assistant about Image Scale and Crop Without Upscale

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • image Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Active

Releases

Version Type Core PHP Release date
2.1.2 Stable 9–11 Oct 23, 2024
2.1.0 Stable 9–10 Aug 4, 2023