Index: image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v
retrieving revision 1.236
diff -u -p -r1.236 image.module
--- image.module	24 Jun 2007 21:07:16 -0000	1.236
+++ image.module	24 Jun 2007 21:33:38 -0000
@@ -301,7 +301,12 @@ function image_prepare(&$node, $field_na
     $node->new_file = TRUE;
 
     // Call hook to allow other modules to modify the original image.
-    module_invoke_all('image_alter', $node, $file->filepath, IMAGE_ORIGINAL);
+    // We do this by hand rather than calling module_invoke_all() because it 
+    // won't pass parameters by reference under PHP 4. See #141994 for info.
+    foreach (module_implements('image_alter') as $name) {
+      $function = $name .'_image_alter';
+      $function($node, $file->filepath, IMAGE_ORIGINAL);
+    }
     _image_build_derivatives($node, TRUE);
   }
 }
@@ -743,7 +748,13 @@ function _image_build_derivatives(&$node
         }
       }
       $node->images[$key] = $destination;
-      module_invoke_all('image_alter', $node, file_create_path($destination), $key);
+      
+      // We do this by hand rather than calling module_invoke_all() because it 
+      // won't pass parameters by reference under PHP 4. See #141994 for info.
+      foreach (module_implements('image_alter') as $name) {
+        $function = $name .'_image_alter';
+        $function($node, file_create_path($destination), $key);
+      }
     }
   }
 }
