function imagecache_autorotate_dimensions in ImageCache Actions 7
Same name and namespace in other branches
- 8 autorotate/imagecache_autorotate.module \imagecache_autorotate_dimensions()
Image dimensions callback for this image effect.
Parameters
array $dimensions: An array with the dimensions (in pixels) to be modified. param array $data An associative array containing the effect data.
1 string reference to 'imagecache_autorotate_dimensions'
- imagecache_autorotate_image_effect_info in autorotate/
imagecache_autorotate.module - Implements hook_image_effect_info().
File
- autorotate/
imagecache_autorotate.module, line 256 - Autorotate image based on EXIF Orientation tag.
Code
function imagecache_autorotate_dimensions(array &$dimensions) {
// We can only know the resulting dimensions if both dimensions are equal.
// Otherwise we need to inspect the image itself, which is not passed in here.
// (this callback was introduced to enhance performance by NOT accessing the
// image file when rendering the width and height attributes of the html img
// tag).
if ($dimensions['width'] !== $dimensions['height']) {
$dimensions['width'] = $dimensions['height'] = NULL;
}
}