You are here

function _image_imagemagick_check_path in Image 7

Same name and namespace in other branches
  1. 5.2 image.imagemagick.inc \_image_imagemagick_check_path()
  2. 5 image.imagemagick.inc \_image_imagemagick_check_path()
  3. 6 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 (file_exists($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 restriction is set to %open_basedir, which may be interfering with the attempts to locate ImageMagick.", array(
        '%file' => $path,
        '%open_basedir' => $open_basedir,
        '@open_basedir' => '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;
}