function pdf_to_imagefield_check_imagemagick in PDF to ImageField 6
Same name and namespace in other branches
- 6.2 pdf_to_imagefield.module \pdf_to_imagefield_check_imagemagick()
- 7 pdf_to_imagefield.module \pdf_to_imagefield_check_imagemagick()
Helper function to check if ImageMagick is ready to convert
1 call to pdf_to_imagefield_check_imagemagick()
- pdf_to_imagefield_widget_settings_form in ./
pdf_to_imagefield.module - Implementation of CCK's hook_widget_settings($op = 'form').
File
- ./
pdf_to_imagefield.module, line 364 - PDF to ImageField core hooks and menu callbacks.
Code
function pdf_to_imagefield_check_imagemagick($widget) {
// init test varaibles
$source = drupal_get_path('module', 'pdf_to_imagefield') . '/imagemagick_test.pdf';
$result = file_directory_path() . '/imagemagick_test.jpg';
$density = !empty($widget['density']) ? $widget['density'] : '100x100';
// check conversion
if (pdf_to_imagefield_convert_pdf($source, $result, array(), array(
'-density ' . $density,
))) {
file_delete($result);
return TRUE;
}
return FALSE;
}