function imageapi_default_toolkit in ImageAPI 5
Same name and namespace in other branches
- 6 imageapi.module \imageapi_default_toolkit()
Retrieve the name of the currently used toolkit.
Return value
String containing the name of the toolkit, or FALSE if none is available.
3 calls to imageapi_default_toolkit()
- imageapi_image_open in ./
imageapi.module - Open an image file and return an image object.
- imageapi_menu in ./
imageapi.module - Implementation of hook_menu().
- imageapi_settings in ./
imageapi.module
File
- ./
imageapi.module, line 130 - An ImageAPI supporting mulitple image toolkits. Image toolkits are implemented as modules. Images are objects, but have no methods
Code
function imageapi_default_toolkit() {
$toolkit = variable_get('imageapi_image_toolkit', 'imageapi_gd');
// Verify that the image toolkit is available.
if (isset($toolkit) && module_exists($toolkit)) {
return $toolkit;
}
// If it's not fall back to first available toolist.
foreach (imageapi_get_available_toolkits() as $toolkit => $info) {
return $toolkit;
}
return FALSE;
}