You are here

function imagepicker_image_check_functions in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.functions.inc \imagepicker_image_check_functions()

Adapted from watermark module.

Return value

Status of function availability.

6 calls to imagepicker_image_check_functions()
imagepicker_copy_form in ./imagepicker.functions.inc
Function to generate the copy form
imagepicker_import_form in ./imagepicker.import.inc
Function to display the image import form.
imagepicker_settings_form in ./imagepicker.admin.inc
Function to display the imagepicker admin settings form
imagepicker_settings_form_validate in ./imagepicker.admin.inc
Validate settings form
imagepicker_upload_form in ./imagepicker.upload.inc

... See full list

File

./imagepicker.functions.inc, line 2534
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_image_check_functions($silent = FALSE) {
  $errors = 0;
  $function_list = array();
  $function_list[] = 'imagecopy';
  $function_list[] = 'imagecopyresampled';
  $function_list[] = 'imagedestroy';
  $types = array(
    'gif',
    'jpeg',
    'png',
    'wbmp',
  );
  foreach ($types as $type) {
    $function_list[] = 'image' . $type;
    $function_list[] = 'imagecreatefrom' . $type;
  }
  foreach ($function_list as $function) {
    if (!function_exists($function)) {
      if (!$silent) {
        drupal_set_message(t('Function %func does not exist. Advanced image manipulation cannot be done. Please make sure that you are running PHP %ver or higher, or that you (or your hosting provider) enable the GD library in your PHP installation.', array(
          '%func' => $function,
          '%ver' => IMAGEPICKER_UPLOAD_STATUS_MIN_PHP,
        )), 'warning');
      }
      $errors++;
    }
  }
  if ($errors) {
    return FALSE;
  }
  return TRUE;
}