You are here

function image_get_toolkit in Drupal 7

Same name and namespace in other branches
  1. 4 includes/image.inc \image_get_toolkit()
  2. 5 includes/image.inc \image_get_toolkit()
  3. 6 includes/image.inc \image_get_toolkit()

Gets the name of the currently used toolkit.

Return value

String containing the name of the selected toolkit, or FALSE on error.

Related topics

8 calls to image_get_toolkit()
FileValidatorTest::testFileValidateImageResolution in modules/simpletest/tests/file.test
This ensures the resolution of a specific file is within bounds. The image will be resized if it's too large.
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.
system_image_toolkit_settings in modules/system/system.admin.inc
Form builder; Configure site image toolkit usage.
UserPictureTestCase::testWithGDinvalidDimension in modules/user/user.test
Do the test: GD Toolkit is installed Picture has invalid dimension

... See full list

File

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

Code

function image_get_toolkit() {
  static $toolkit;
  if (!isset($toolkit)) {
    $toolkits = image_get_available_toolkits();
    $toolkit = variable_get('image_toolkit', 'gd');
    if (!isset($toolkits[$toolkit]) || !function_exists('image_' . $toolkit . '_load')) {

      // The selected toolkit isn't available so return the first one found. If
      // none are available this will return FALSE.
      reset($toolkits);
      $toolkit = key($toolkits);
    }
  }
  return $toolkit;
}