You are here

function imageapi_imagemagick_image_rotate in ImageAPI 6

Same name and namespace in other branches
  1. 5 imageapi_imagemagick.module \imageapi_imagemagick_image_rotate()

File

./imageapi_imagemagick.module, line 122
ImageMagick toolkit functions

Code

function imageapi_imagemagick_image_rotate(&$image, $degrees, $bgcolor) {
  if (is_int($bgcolor)) {
    $bgcolor = '#' . str_pad(dechex($bgcolor), 6, 0);
  }
  else {
    $bgcolor = str_replace('0x', '#', $bgcolor);
  }
  $image->ops[] = '-background ' . escapeshellarg($bgcolor) . ' -rotate ' . (double) $degrees;
  return TRUE;
}