• Resolved kaldimar

    (@kaldimar)


    I want to report an issue with the thumbnail generation on a server where ghostscript is unavailable. I got the same error than other users after the upgrade, had to deactivate and delete the plugin and data and do a fresh install, that worked nice in my development server using ghostscript, the pdf thumbnails were generated. However in another server, with exec() permissions disabled, the icon being loaded is the generic pdf one, despite the Locally and Imagick options selected. Any ideas why is it failing?

    https://wordpress.org/plugins/document-gallery/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Dan Rossiter

    (@danrossiter)

    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

    Thread Starter kaldimar

    (@kaldimar)

    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?

    Plugin Author Dan Rossiter

    (@danrossiter)

    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

    Plugin Author Dan Rossiter

    (@danrossiter)

    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

    Plugin Author Dan Rossiter

    (@danrossiter)

    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

    Thread Starter kaldimar

    (@kaldimar)

    Now it works perfect without ghostscript enabled just by upgrading to 2.0.2. Thanks for taking your time to polish this plugin update!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘thumbnail generation fails if ghostscript not available’ is closed to new replies.