kaldimar,
Imagick delegates PDF processing to Ghostscript (less efficiently than running Ghostscript directly). My bet is that your Imagick is not able to process PDFs either because GS isn’t on the server or because Imagick wasn’t compiled to support the GS delegate.
That said, we can do a little digging to verify that this is indeed the case. If you create a .php file somewhere on your server with the following: <?php var_dump(Imagick::queryFormats()); ?>, the output should have a list of file extensions. If the extensions include “pdf,” then something probably is wrong. If not, it just means that Imagick doesn’t know what to do with a PDF, which is resulting in your thumbnails falling back to the default.
Please let me know what results you get. Thanks!
-Dan
The formats Imagick can process on my server do include PDF:
array(193) {
[0]=>
string(3) "3FR"
...
string(3) "PDB"
[111]=>
string(3) "PDF"
[112]=>
string(4) "PDFA"
...
[192]=>
string(3) "YUV"
}
But on the settings page, just above the text field for the gs path, there is a notice saying
NOTE: exec() is not accessible. Ghostscript will not function.
This is a shared server and I can tell it’s rather limited. What do you recommend? Is my only option to rely on the Google service, or do I still have local alternatives?
Interesting. Based on that output, Imagick should definitely be handling PDFs.
I built logging into thumbnail generation so the next step would be to enable WP_DEBUG and see what is being logged to the PHP error log.
Note that if you’ve got a thumbnail that already failed generation then that failure is cached, so you’ll want to upload another copy of the PDF after you’ve enabled debugging.
Please let me know if you have any questions. I know that’s a rather complicated set of debugging steps.
-Dan
kaldimar,
My test server exploded (metaphorically) the other day, so I was unable to try and reproduce this until just now. I have the same problem here, so I can narrow down the cause and hope to have a fix out by tomorrow morning.
Thanks for reporting this!
-Dan
I believe version 2.0.2 should resolve the problems with Imagick. I’m going to mark this as resolved, but if you could verify that everything looks right when you get a chance I would appreciate it.
Thanks!
-Dan
Now it works perfect without ghostscript enabled just by upgrading to 2.0.2. Thanks for taking your time to polish this plugin update!