You are here

function pdf_to_image_check_imagemagick in PDF to ImageField 7.3

Check the binary path of 'convert' on the server.

Returns NULL if it failed, the version info of ImageMagick if it succeeds.

2 calls to pdf_to_image_check_imagemagick()
pdf_to_image_convert_exec in ./pdf_to_image.module
Actually execute the shell command.
pdf_to_image_requirements in ./pdf_to_image.install
Implements hook_requirements().

File

./pdf_to_image.module, line 717
Generates thumbnail image(s) from an uploaded PDF.

Code

function pdf_to_image_check_imagemagick() {
  static $response;
  if (isset($response)) {
    return $response;
  }
  $convert_path = variable_get('imagemagick_convert', '/usr/bin/convert');
  $response = pdf_to_image_shell_exec($convert_path . ' -version');

  // Here I should also check that the "Delegates:" info does include 'pdf'.
  return $response;
}