Area Scaler

Component ID

1543536

Component name

Area Scaler

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module adds an image style effect for scaling images to a size that is specified by the area the image should cover.

When scaling images with the regular scale effect, one can only specify the height/width of the resulting image. With this, the scaled versions of images that are nearly as high as wide, appear much bigger than images with very diverse dimensions.

This module adds a scale effect that allows the user to give the desired area that the scaled image should cover. In other words, one can say something like: "I want the resulting image in a size that looks like 200x200".

Features

  • adds the "Area Scale" effect for image styles
  • scales images to given area, not width and height
  • maximum for width and height can be given to better theme the output

Requirements

No additional modules, just the core Image module.

Example

The following table shows three images with different aspect ratios scaled with the regular scaler and the area scaler to 150x150 pixel. The first row shows the results of the regular scaler, the second one the results of the area scaler. Notice that in the first row, the second and the third image look smaller that the first one. With the area scaler, this is not the case.

square image with regular scaler high image with regular scaler wide image with regular scaler
square image with regular scaler high image with regular scaler wide image with regular scaler