image_toolkit_invoke
Definition
image_toolkit_invoke($method, $params = array())
includes/image.inc, line 88
Description
Invokes the given method using the currently selected toolkit.
Parameters
$method A string containing the method to invoke.
$params An optional array of parameters to pass to the toolkit method.
Return value
Mixed values (typically Boolean indicating successful operation).
Related topics
| Name | Description |
|---|---|
| Image toolkits | Drupal's image toolkits provide an abstraction layer for common image file manipulations like scaling, cropping, and rotating. The abstraction frees module authors from the need to support multiple image libraries, and it allows site... |
Code
<?php
function image_toolkit_invoke($method, $params = array()) {
if ($toolkit = image_get_toolkit()) {
$function = 'image_' . $toolkit . '_' . $method;
if (drupal_function_exists($function)) {
return call_user_func_array($function, $params);
}
else {
watchdog('php', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $toolkit, '%function' => $function), WATCHDOG_ERROR);
return FALSE;
}
}
}
?> 