Index: modules/system/image.gd.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/image.gd.inc,v
retrieving revision 1.18
diff -u -p -r1.18 image.gd.inc
--- modules/system/image.gd.inc	28 Oct 2010 02:27:09 -0000	1.18
+++ modules/system/image.gd.inc	25 Nov 2010 05:18:24 -0000
@@ -116,8 +116,8 @@ function image_gd_resize(stdClass $image
  * @see image_rotate()
  */
 function image_gd_rotate(stdClass $image, $degrees, $background = NULL) {
-  // PHP installations using non-bundled GD do not have imagerotate.
-  if (!function_exists('imagerotate')) {
+  // PHP installations using non-bundled GD do not have imagerotate or ImageMagick's rotateimage.
+  if (!function_exists('imagerotate') && !function_exists('rotateimage')) {
     watchdog('image', 'The image %file could not be rotated because the imagerotate() function is not available in this PHP installation.', array('%file' => $image->source));
     return FALSE;
   }
@@ -153,7 +153,13 @@ function image_gd_rotate(stdClass $image
     }
   }
 
-  $image->resource = imagerotate($image->resource, 360 - $degrees, $background);
+  if (!function_exists('imagerotate')) {
+    $image->resource = imagerotate($image->resource, 360 - $degrees, $background);
+  } 
+  else {
+    $image = new Imagick($image->resource); 
+    $image->resource = $image->rotateimage("transparent", 360 - $degrees);
+  }
 
   // GIFs need to reassign the transparent color after performing the rotate.
   if (isset($transparent_gif_color)) {
