You are here

function image_imageinfo_cache_rotate in Imageinfo Cache 7.3

Rotates an image the given number of degrees.

Parameters

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

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

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

bool TRUE or FALSE, based on success.

See also

image_rotate()

File

./imageinfo_cache.toolkit.inc, line 243
Imageinfo Cache module. Pseudo image toolkit functions.

Code

function image_imageinfo_cache_rotate($image, $degrees, $background = NULL) {

  // Change toolkit back to the original value.
  $image->toolkit = variable_get('image_toolkit_original', 'gd');
  $return = image_toolkit_invoke('rotate', $image, array(
    $degrees,
    $background,
  ));

  // Change toolkit to the pseudo value again.
  $image->toolkit = variable_get('image_toolkit', 'gd');
  return $return;
}