You are here

function _image_imagemagick_check_path in Image 5.2

Same name and namespace in other branches
  1. 5 image.imagemagick.inc \_image_imagemagick_check_path()
  2. 6 image.imagemagick.inc \_image_imagemagick_check_path()
  3. 7 image.imagemagick.inc \_image_imagemagick_check_path()
2 calls to _image_imagemagick_check_path()
_image_imagemagick_build_version in ./image.imagemagick.inc
_image_imagemagick_convert_exec in ./image.imagemagick.inc

File

./image.imagemagick.inc, line 53

Code

function _image_imagemagick_check_path($path, $attach_error_to = FALSE) {
  if (is_file($path)) {
    return TRUE;
  }
  if ($attach_error_to) {
    if ($open_basedir = ini_get('open_basedir')) {
      form_set_error($attach_error_to, t("No file %file could be found. PHP's <a href='!open-basedir'>open_basedir</a> security resriction is set to %open-basedir, which may be interfering with the attempts to locate ImageMagick.", array(
        '%file' => $path,
        '%open-basedir' => $open_basedir,
        '!info-link' => url('http://php.net/features.safe-mode#ini.open-basedir'),
      )));
    }
    else {
      form_set_error($attach_error_to, t('The specified ImageMagic path %file does not exist.', array(
        '%file' => $path,
      )));
    }
  }
  return FALSE;
}