1 image.effects.inc image_scale_dimensions(array &$dimensions, array $data)

Image dimensions callback; Scale.

Parameters

$dimensions: Dimensions to be modified - an array with components width and height, in pixels.

$data: An array of attributes to use when performing the scale effect with the following items:

  • "width": An integer representing the desired width in pixels.
  • "height": An integer representing the desired height in pixels.
  • "upscale": A boolean indicating that the image should be upscaled if the dimensions are larger than the original image.

File

core/modules/image/image.effects.inc, line 152
Functions needed to execute image effects provided by Image module.

Code

function image_scale_dimensions(array &$dimensions, array $data) {
  if ($dimensions['width'] && $dimensions['height']) {
    image_dimensions_scale($dimensions, $data['width'], $data['height'], $data['upscale']);
  }
}