function image_scale_dimensions

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.
1 string reference to 'image_scale_dimensions'
image_image_effect_info in modules/image/image.effects.inc
Implements hook_image_effect_info().

File

modules/image/image.effects.inc, line 153

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.