When using the module together with imagecache_actions (canvasactions) I get the following error:

TypeError: Argument 2 passed to image_gd_definecanvas() must be of the type array, string given, called in /sites/all/modules/contrib/imageapi_optimize/imageapi_optimize.module on line 205 in image_gd_definecanvas() (Zeile 365 von /sites/all/modules/contrib/imagecache_actions/canvasactions/canvasactions.inc).

I have no clue why that happens...

Comments

Anybody created an issue. See original summary.

Anybody’s picture

Issue summary: View changes
Steven Jones’s picture

Status: Active » Closed (cannot reproduce)

From looking at the code for canvasactions_definecanvas_image it always casts to an array rather than a string, so I'm not sure how you'd get this.

Anybody’s picture

I was not able to solve this problem finally. It only seems to happen in the combination of imagecache_actions + imageapi_optimize when using image_gd_definecanvas.

I have no clue and finally worked around it by an excluding if condition:

/**
 * Helper. Based on image_toolkit_invoke()
 */
function _imageapi_optimize_invoke($method, $image, array $params = array()) {
  $function = 'image_' . variable_get('imageapi_optimize_toolkit', '') . '_' . $method;
  if (function_exists($function) && $function != 'image_gd_definecanvas') {
    array_unshift($params, $image);
    return call_user_func_array($function, $params);
  }
  return FALSE;
}