? imageapi-transparency_on_temp_images.patch
Index: imageapi_gd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.module,v
retrieving revision 1.12
diff -u -p -r1.12 imageapi_gd.module
--- imageapi_gd.module	9 Jul 2008 02:49:47 -0000	1.12
+++ imageapi_gd.module	6 Jan 2009 23:26:30 -0000
@@ -74,6 +74,9 @@ function imageapi_gd_image_rotate(&$imag
   $res = imagerotate($image->res, 360 - $degrees, $bgcolor);
   imagedestroy($image->res);
   $image->res = $res;
+  // Update the info with the new real dimensions. Required if scaling later.
+  $image->info['width'] = imagesx($image->res);
+  $image->info['height'] = imagesy($image->res);
   return true;
 } 
 
@@ -133,6 +136,11 @@ if (!function_exists('imagefilter')) {
  */
 function _gd_create_tmp($image, $width, $height) { 
   $res = imagecreatetruecolor($width, $height);
+
+  // Alpha settings have no negative effect on jpegs, 
+  // but do help them support layering better for in-between steps.
+  imagealphablending($res, FALSE);
+  imagesavealpha($res, TRUE);
   
   if ($image->info['extension'] == 'gif' || $image->info['extension'] == 'jpg') {
     // grab transparent color index from src.
@@ -152,14 +160,12 @@ function _gd_create_tmp($image, $width, 
       imagefill($res, 0, 0, $transparent);
       // tell the new image which color is transparent.
       imagecolortransparent($res, $transparent);
+
     }
   }
   elseif ($image->info['extension'] == 'png') {
-    imagealphablending($res, false);
     $transparency = imagecolorallocatealpha($res, 0, 0, 0, 127);
     imagefill($res, 0, 0, $transparency);
-    imagealphablending($res, true);
-    imagesavealpha($res, true);
   }
   return $res;
 }
