You are here

function image_toolkit_invoke in Drupal 7

Same name and namespace in other branches
  1. 4 includes/image.inc \image_toolkit_invoke()
  2. 5 includes/image.inc \image_toolkit_invoke()
  3. 6 includes/image.inc \image_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 image_load().

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

Return value

Mixed values (typically Boolean indicating successful operation).

Related topics

7 calls to image_toolkit_invoke()
image_crop in includes/image.inc
Crops an image to a rectangle specified by the given dimensions.
image_desaturate in includes/image.inc
Converts an image to grayscale.
image_get_info in includes/image.inc
Gets details about an image.
image_load in includes/image.inc
Loads an image file and returns an image object.
image_resize in includes/image.inc
Resizes an image to the given dimensions (ignoring aspect ratio).

... See full list

File

includes/image.inc, line 93
API for manipulating images.

Code

function image_toolkit_invoke($method, stdClass $image, array $params = array()) {
  $function = 'image_' . $image->toolkit . '_' . $method;
  if (function_exists($function)) {
    array_unshift($params, $image);
    return call_user_func_array($function, $params);
  }
  watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array(
    '%toolkit' => $image->toolkit,
    '%function' => $function,
  ), WATCHDOG_ERROR);
  return FALSE;
}