| 5 image.inc | image_gd_rotate($source, $destination, $degrees, |
| 6 image.gd.inc | image_gd_rotate( |
| 7 image.gd.inc | image_gd_rotate(stdClass $image, $degrees, $background = NULL) |
| 8 image.gd.inc | image_gd_rotate(stdClass $image, $degrees, $background = NULL) |
Rotate an image the given number of degrees.
Related topics
File
- includes/
image.gd.inc, line 132 - GD2 toolkit for image manipulation within Drupal.
Code
function image_gd_rotate($source, $destination, $degrees, $background = 0x000000) {
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, $background);
$result = image_gd_close($res, $destination, $info['extension']);
return $result;
}
Login or register to post comments