You are here

function imageapi_toolkit_invoke in ImageAPI 5

Same name and namespace in other branches
  1. 6 imageapi.module \imageapi_toolkit_invoke()

Invokes the given method using the currently selected toolkit.

Parameters

$method: A string containing the method to invoke.

$image: An image object returned by imageapi_image_open().

$params: An optional array of parameters to pass to the toolkit method.

Return value

Mixed values (typically Boolean indicating successful operation).

7 calls to imageapi_toolkit_invoke()
imageapi_image_close in ./imageapi.module
Close the image and save the changes to a file.
imageapi_image_crop in ./imageapi.module
Crop an image to the rectangle specified by the given rectangle.
imageapi_image_desaturate in ./imageapi.module
Convert an image to grayscale.
imageapi_image_open in ./imageapi.module
Open an image file and return an image object.
imageapi_image_resize in ./imageapi.module
Resize an image to the given dimensions (ignoring aspect ratio).

... See full list

File

./imageapi.module, line 155
An ImageAPI supporting mulitple image toolkits. Image toolkits are implemented as modules. Images are objects, but have no methods

Code

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', t('The selected image handling toolkit %toolkit can not correctly process %function.', array(
    '%toolkit' => $image->toolkit,
    '%function' => $function,
  )), WATCHDOG_ERROR);
  return FALSE;
}