image_gd_rotate

Versions
4.6 – 5
image_gd_rotate($source, $destination, $degrees, $bg_color = 0)
6
image_gd_rotate($source, $destination, $degrees, $background = 0x000000)
7
image_gd_rotate(stdClass $image, $degrees, $background = NULL)

Rotate an image the given number of degrees.

Code

includes/image.inc, line 233

<?php
function image_gd_rotate($source, $destination, $degrees, $bg_color = 0) {
  if (!function_exists('imageRotate')) {
    return false;
  }

  $info = image_get_info($source);
  if (!$info) {
    return false;
  }

  $im = image_gd_open($source, $info['extension']);
  if (!$im) {
    return false;
  }

  $res = imageRotate($im, $degrees, $bg_color);
  $result = image_gd_close($res, $destination, $info['extension']);

  return $result;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.