? im_rotate_bgcolor.patch
Index: imageapi_imagemagick.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagemagick.module,v
retrieving revision 1.19
diff -u -p -r1.19 imageapi_imagemagick.module
--- imageapi_imagemagick.module	5 Jan 2009 22:58:52 -0000	1.19
+++ imageapi_imagemagick.module	12 Feb 2009 16:39:36 -0000
@@ -120,13 +120,13 @@ function imageapi_imagemagick_image_resi
 }
 
 function imageapi_imagemagick_image_rotate(&$image, $degrees, $bgcolor) {
-  if (is_numeric($bgcolor)) {
+  if (is_int($bgcolor)) {
     $bgcolor = '#'. str_pad(dechex($bgcolor), 6, 0);
   }
   else {
     $bgcolor = str_replace('0x', '#', $bgcolor);
   }
-  $image->ops[] = '-rotate '. (float) $degrees .' -background '. escapeshellarg($bgcolor) ;
+  $image->ops[] = '-background '. escapeshellarg($bgcolor) .' -rotate '. (float) $degrees;
   return true;
 }
 
