You are here

function image_imagick_rotate in Imagick 7

Rotate an image the given number of degrees.

Parameters

$image: An image object. The $image->resource, $image->info['width'], and $image->info['height'] values will be modified by this call.

$degrees: The number of (clockwise) degrees to rotate the image.

$background: An hexadecimal integer specifying the background color to use for the uncovered area of the image after the rotation. E.g. 0x000000 for black, 0xff00ff for magenta, and 0xffffff for white. For images that support transparency, this will default to transparent. Otherwise it will be white.

Return value

TRUE or FALSE, based on success.

See also

image_rotate()

File

effects/imagick.rotate.inc, line 22

Code

function image_imagick_rotate(stdClass $image, $degrees, $background = NULL) {
  $success = _imagick_process_frames($image, 'image_imagick_rotate_process', func_get_args());

  // Set correct dimensions
  $image->info['width'] = $image->resource->width;
  $image->info['height'] = $image->resource->height;
  return $success;
}