In File pdf-thumbnails/pdf-thumbnails.php
search for function pdf_thumbnails_admin_int() and use following changes:
function pdf_thumbnails_admin_int()
{
//if (!extension_loaded(‘imagick’)) {
// add_action(‘admin_notices’, ‘pdf_thumbnails_missing_imagick’);
// return;
//}
add_filter(‘wp_generate_attachment_metadata’, ‘pdf_thumbnails_generate_attachment_metadata’, 10, 2);
add_action(‘deleted_post’, ‘pdf_thumbnails_deleted_post’);
}
In file pdf-thumbnails/PdfThumbnailsPlugin.php
search for function getThumbnailBlob($filename) and use following changes:
private function getThumbnailBlob($filename)
{
$blob = apply_filters(‘pdf_thumbnails_generate_image_blob’, null, $filename);
if ($blob) {
return $blob;
}
/*
$imagick = new Imagick($filename);
$imagick->setIteratorIndex(0);
$imagick->setImageFormat(‘jpg’);
return $imagick->getImageBlob();
*/
$arrPathInfo = pathinfo($filename);
$strFilename = $arrPathInfo[“filename”];
$strFilenameOut = “./” . $strFilename . “-pdf-image.jpg”;
exec(“convert $filename”.”[0]”.” $strFilenameOut”);
$strReturn = file_get_contents($strFilenameOut);
unlink($strFilenameOut);
return $strReturn;
}