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

Image dimensions callback; Resize.


$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.


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


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'];