Login

Contact

You can leave a message using the contact form below.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Error in module ImageApi

Hide all descriptions
Error description: 

Error displayed when you use modules ImageApi, ImageCache

warning: Parameter 1 to imageapi_gd_image_resize() expected to be a reference, value given in .../modules/imageapi/imageapi.module on line 165

Cause of the problem in using PHP version 5.3

The solution is quite easy, although it will have to rewrite slightly module imageapi. To do this, open the folder with the module and open the file in the editor imageapi.module. Then go to line 163 where we see the following:

<?php
function imageapi_toolkit_invoke($method, &$image, array $params = array()) {
 
$function = $image->toolkit . '_image_' . $method;
  if (
function_exists($function)) {
   
array_unshift($params, $image);
    return
call_user_func_array($function, $params);
  }
 
watchdog('imageapi', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR);
  return
FALSE;
}
?>

Now this function, we need to slightly adjust the following:

<?php
function imageapi_toolkit_invoke($method, &$image, array $params = array()) {
 
$function = $image->toolkit . '_image_' . $method;
  if (
function_exists($function)) {
   
array_unshift($params, $image);
       
$params[0] = &$image;
    return
call_user_func_array($function, $params);
  }
 
watchdog('imageapi', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR);
  return
FALSE;
}
?>