WPIntell

Source evidence

No php ext imagemagick

PDF Thumbnails · support · 2017-01-24T08:23:00+00:00

complaintsentiment
mediumseverity
0.92relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 22 rows with source links

9.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
linuxpinguin unresolved
Hi guys, thanks a lot for this plugin. I’ve tried it and it does as expected. We use german hoster “strato” which does not installed imagemagick as a php extension but as normal command line tool. Do you have plans to implement handling such configurations also? Hi, I did not have plans to implement fallback to the command line tool, but it looks like it can be done without too much of an effort. I will look into this and come back to you. Hi Stianlik, because I needed it for a project I implemented it dirty so far … After disabling extension-check I replaced Imagick-Routine with: $arrPathInfo = pathinfo($filename); $strFilename = $arrPathInfo[“filename”]; $strFilenameOut = “userdefinedpath/” . $strFilename . “-pdf-image.jpg”; exec(“convert $filename”.”[0]”.” $strFilenameOut”); $strReturn = file_get_contents($strFilenameOut); unlink($strFilenameOut); return $strReturn; This reply was modified 9 years, 3 months ago by linuxpinguin . Reason: Deleting thumbnailimage Hi, it happens that I also need this for a project. Appreciate your dirty implementation, unfortunately, I can’t seem to get it to work. I don’t know why, but the output file is always 0 bytes in size and therefore not being displayed. I have never worked with the ImageMagick binaries before. Am I missing something here? Which lines do I have to replace exactly? Thank you for your help. 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; } Hi, thank you for your detailed explanation. Also realized that Ghostscript was missing on my server. Everything is working now. 🙂

Comments

5 shown
stianlik 2017-01-26T07:22:00+00:00

Hi, I did not have plans to implement fallback to the command line tool, but it looks like it can be done without too much of an effort. I will look into this and come back to you.

linuxpinguin 2017-02-02T08:59:00+00:00

Hi Stianlik, because I needed it for a project I implemented it dirty so far … After disabling extension-check I replaced Imagick-Routine with: $arrPathInfo = pathinfo($filename); $strFilename = $arrPathInfo[“filename”]; $strFilenameOut = “userdefinedpath/” . $strFilename . “-pdf-image.jpg”; exec(“convert $filename”.”[0]”.” $strFilenameOut”); $strReturn = file_get_contents($strFilenameOut); unlink($strFilenameOut); return $strReturn; This reply was modified 9 years, 3 months ago by linuxpinguin . Reason: Deleting thumbnailimage

wolfcrest 2017-02-18T00:10:00+00:00

Hi, it happens that I also need this for a project. Appreciate your dirty implementation, unfortunately, I can’t seem to get it to work. I don’t know why, but the output file is always 0 bytes in size and therefore not being displayed. I have never worked with the ImageMagick binaries before. Am I missing something here? Which lines do I have to replace exactly? Thank you for your help.

linuxpinguin 2017-02-18T12:56:00+00:00

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; }

wolfcrest 2017-02-19T15:37:00+00:00

Hi, thank you for your detailed explanation. Also realized that Ghostscript was missing on my server. Everything is working now. 🙂