function image_resize_dimensions

Image dimensions callback; Resize.

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 resize effect with the following items:

  • "width": An integer representing the desired width in pixels.
  • "height": An integer representing the desired height in pixels.
1 string reference to 'image_resize_dimensions'
image_image_effect_info in modules/image/image.effects.inc
Implements hook_image_effect_info().

File

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

Code

function image_resize_dimensions(array &$dimensions, array $data) {
    // The new image will have the exact dimensions defined for the effect.
    $dimensions['width'] = $data['width'];
    $dimensions['height'] = $data['height'];
}

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