You are here

function imageapi_default_toolkit in ImageAPI 6

Same name and namespace in other branches
  1. 5 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 134
An ImageAPI supporting additional image plugins as modules. Images are treated as objects, and images are not written per manipulation as Drupal's core image handling works.

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;
}