You are here

function image_resize_dimensions in Drupal 7

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
Functions needed to execute image effects provided by Image module.

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