Error in coloractions

Farreres - June 11, 2008 - 08:52
Project:Imagecache Actions
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:patch (to be ported)
Description

* warning: imagefilter() expects exactly 3 parameters, 5 given in /modules/imagecache_actions/imagecache_coloractions.module on line 201.
* recoverable fatal error: Object of class stdClass could not be converted to string in /web/includes/bootstrap.inc on line 667.
* warning: preg_match() expects parameter 2 to be string, object given in /web/includes/bootstrap.inc on line 670.
* warning: preg_match() expects parameter 2 to be string, array given in web/includes/bootstrap.inc on line 670.

#1

dvgm - September 14, 2008 - 09:24

I had the same error and solved it by replacing the following line of code in the imagecache_gd_imagefilter function in imagecache_coloractions.module

return imagefilter($image->res, $filter, $arg1, $arg2, $arg3);

by

  if (!is_null($arg2) && !is_null($arg3)) {
    return imagefilter($image->res, $filter, $arg1, $arg2, $arg3);
  }
  else if (!is_null($arg2) && is_null($arg3)) {
    return imagefilter($image->res, $filter, $arg1, $arg2);
  }
  else if (is_null($arg2) && is_null($arg3)) {
    return imagefilter($image->res, $filter, $arg1);
  }

Thanks to Eaton which gave me the hint at http://drupal.org/node/212537.

#2

Countzero - October 6, 2008 - 15:45

Thanks a lot for this fix. Shouldn't it be commited to main source ?

#3

dman - October 9, 2008 - 07:55
Status:active» patch (to be ported)

Applied to 6-1-dev
May be backported one day.

 
 

Drupal is a registered trademark of Dries Buytaert.