You are here

function retina_images_image_scale_effect in Retina Images 7

Image effect callback; Scale an image resource.

Parameters

$image: An image object returned by image_load().

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

Return value

TRUE on success. FALSE on failure to scale image.

See also

image_scale()

1 string reference to 'retina_images_image_scale_effect'
retina_images_image_effect_info_alter in ./retina_images.module
Implements hook_image_effect_info_alter

File

./retina_images.module, line 137
This module provides an image effect to assist in outputing high resolution images.

Code

function retina_images_image_scale_effect(&$image, $data) {

  // Set sane default values.
  $data += array(
    'width' => NULL,
    'height' => NULL,
    'upscale' => FALSE,
  );
  retina_images_multiply_data_dimensions($data);
  return image_scale_effect($image, $data);
}