Index: textrender.inc
===================================================================
--- textrender.inc	(revision 53)
+++ textrender.inc	(working copy)
@@ -137,6 +137,6 @@
   // Calc the position on the canvas
   $xy = imagecache_actions_calculate_relative_position($image, $textimage, $style);
 #dpm(get_defined_vars());
-  return imageapi_image_overlay($image, $textimage, $xy['x'], $xy['y']);
+  return imageapi_image_overlay(&$image, &$textimage, $xy['x'], $xy['y']);
 }
 
Index: canvasactions.inc
===================================================================
--- canvasactions.inc	(revision 53)
+++ canvasactions.inc	(working copy)
@@ -236,7 +236,7 @@
       ),
       'toolkit' => $image->toolkit,
     );
-    imageapi_image_overlay($canvas_object, $image, $targetsize['left'], $targetsize['top'], 100, TRUE);
+    imageapi_image_overlay(&$canvas_object, &$image, $targetsize['left'], $targetsize['top'], 100, TRUE);
   } 
   else {
     $image->resource = $newcanvas ;
@@ -282,7 +282,7 @@
       ),
       'toolkit' => $image->toolkit,
     );
-    imageapi_image_overlay($canvas_object, $image, $targetsize['left'], $targetsize['top'], 100, TRUE);
+    imageapi_image_overlay(&$canvas_object, &$image, $targetsize['left'], $targetsize['top'], 100, TRUE);
   } 
   else {
     $image->resource = $newcanvas ;
@@ -436,7 +436,7 @@
   #imagecache_crop_image($image, $crop_rules);
 
   // This func modifies the underlay image by ref, placing the current canvas on it
-  if (imageapi_image_overlay($underlay, $image, $action['xpos'], $action['ypos'], $action['alpha'], TRUE)) {
+  if (imageapi_image_overlay(&$underlay, &$image, $action['xpos'], $action['ypos'], $action['alpha'], TRUE)) {
     $image->resource = $underlay->resource;
     return TRUE;
   }
@@ -529,7 +529,7 @@
     trigger_error(t("Failed to find overlay image %path for imagecache_actions file-to-canvas action. File was not found in the sites 'files' path or the current theme folder.", array('%path' => $action['path'])), E_USER_WARNING);
     return FALSE;
   }
-  return imageapi_image_overlay($image, $overlay, $action['xpos'], $action['ypos'], $action['alpha']);
+  return imageapi_image_overlay(&$image, &$overlay, $action['xpos'], $action['ypos'], $action['alpha']);
 }
 
 
@@ -586,7 +586,7 @@
   */   
 function canvasactions_source2canvas_image(&$image, $action = array()) {    
   $overlay = imageapi_image_open($image->source); // this probably means opening the image twice. c'est la vie    
-  return imageapi_image_overlay($image, $overlay, $action['xpos'], $action['ypos'], $action['alpha']);      
+  return imageapi_image_overlay(&$image, &$overlay, $action['xpos'], $action['ypos'], $action['alpha']);      
 }
 
 ///////////////////////////////////////////////////////////////////
Index: imagecache_canvasactions.module
===================================================================
--- imagecache_canvasactions.module	(revision 53)
+++ imagecache_canvasactions.module	(working copy)
@@ -167,7 +167,7 @@
  * to replace the old image resource with the new one.
  * @return bool success
  */
-function imageapi_gd_image_overlay(&$image, &$layer, $x, $y, $alpha = 100, $reverse = FALSE) {
+function imageapi_gd_image_overlay(&$image, $layer, $x, $y, $alpha = 100, $reverse = FALSE) {
 
   // If the given alpha is 100%, we can use imagecopy - which actually works, 
   // Is more efficient, and seems to retain the overlays partial transparancy
@@ -272,4 +272,4 @@
       'arguments' => array('element' => NULL),
     ),
   );
-}
\ No newline at end of file
+}
Index: textactions.inc
===================================================================
--- textactions.inc	(revision 53)
+++ textactions.inc	(working copy)
@@ -231,7 +231,7 @@
   $action['alpha'] = ($action['alpha'] / 100); //Convert to decimal between 0 and 1
   $action['RGB']['alpha'] = ((1 - $action['alpha']) * 127); //convert opacity to proper alpha value (0 = opaque, 127 = transparent)
 
-  return imageapi_image_overlaytext_alpha($image, $text, $action['size'], $x_ins, $y_ins, $action['RGB'], $fontpath, $action['angle']);
+  return imageapi_image_overlaytext_alpha(&$image, $text, $action['size'], $x_ins, $y_ins, $action['RGB'], $fontpath, $action['angle']);
 }
 
 /**
