image_get_toolkit

Versions
4.6 – 7
image_get_toolkit()

Retrieve the name of the currently used toolkit.

Return value

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

Related topics

▾ 3 functions call image_get_toolkit()

image_get_info in includes/image.inc
Get details about an image.
image_load in includes/image.inc
Load an image file and return an image object.
system_image_toolkit_settings in modules/system/system.admin.inc
Form builder; Configure site image toolkit usage.

Code

includes/image.inc, line 61

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.