--- ./imageapi_imagemagick.module	Sun Oct 17 19:03:13 2010
+++ ./imageapi_imagemagick.module.new	Fri Jan 28 17:31:20 2011
@@ -122,17 +122,13 @@
 
 function image_imageapi_imagemagick_rotate(stdClass $image, $degrees, $background = NULL) {
   if (is_null($background)) {
-    $image->ops[] = ' -rotate '. (float) $degrees;
-  }
-  else {
-    if (is_int($bgcolor)) {
-      $bgcolor = '#'. str_pad(dechex($bgcolor), 6, 0);
-    }
-    else {
-      $bgcolor = str_replace('0x', '#', $bgcolor);
-    }
-    $image->ops[] = '-background '. escapeshellarg($bgcolor) .' -rotate '. (float) $degrees;
+    $bgcolor = 'transparent';
+  } elseif (is_int($background)) {
+    $bgcolor = '#'. str_pad(dechex($background), 6, 0);
+  } else {
+    $bgcolor = str_replace('0x', '#', $background);
   }
+  $image->ops[] = '-background '. escapeshellarg($bgcolor) .' -rotate '. (float) $degrees;
   return TRUE;
 }
 
