Image dimensions callback; Rotate.
array $dimensions: Dimensions to be modified - an array with components width and height, in pixels.
array $data: An array of attributes to use when performing the rotate effect containing the following items:
function image_rotate_dimensions(array &$dimensions, array $data) {
// If the rotate is not random and the angle is a multiple of 90 degrees,
// then the new dimensions can be determined.
if (!$data['random'] && (int) $data['degrees'] == $data['degrees'] && $data['degrees'] % 90 == 0) {
if ($data['degrees'] % 180 != 0) {
$temp = $dimensions['width'];
$dimensions['width'] = $dimensions['height'];
$dimensions['height'] = $temp;
}
}
else {
$dimensions['width'] = $dimensions['height'] = NULL;
}
}