• Resolved Knut23

    (@knut23)


    Hi David!

    I am back with another pdf problem and I hope you can shed some light over this. Let me begin with saying thank you very much for the plug in! It really is excellent!

    On s o m e pdf’s I am not able to generate a thumbnail. I get a message (when trying to generate thumbnail in MLA) saying:

    ERROR: Item 1753, thumbnail generation failed - Image load exception: FailedToExecuteCommand‘gs’ -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 ‘-sDEVICE=pngalpha’ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 ‘-r72x72’ -dFirstPage=1 -dLastPage=1 ‘-sOutputFile=/tmp/magick-52801m9cWNRFThxiO%d’ ‘-f/tmp/magick-52801IFHlyyASIlet’ ‘-f/tmp/magick-528010HsBA6gMmLXa” (-1) @ error/delegate.c/ExternalDelegateCommand/462`

    I should also mention that those pdf’s does not generate a native WordPress preview image either…
    Link to a “non preview-thumbnail-generating” pdf.

    Another thing is that some pdf thumbnails and previews does not handle transparency very well. They either become black or white or other erroneous colors (in parts of the image). This might not be related, but I see something about “pngalpha” in the error message, which I guess is about transparency.

    Do you have any idea on what is going on?

    Thanks in advance!
    Regards,
    Richard

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Knut23

    (@knut23)

    Sorry! The code-tag messed the error message. Here it is in plain text:

    ERROR: Item 1753, thumbnail generation failed – Image load exception: FailedToExecuteCommand `’gs’ -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 ‘-sDEVICE=pngalpha’ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 ‘-r72x72’ -dFirstPage=1 -dLastPage=1 ‘-sOutputFile=/tmp/magick-52801m9cWNRFThxiO%d’ ‘-f/tmp/magick-52801IFHlyyASIlet’ ‘-f/tmp/magick-528010HsBA6gMmLXa” (-1) @ error/delegate.c/ExternalDelegateCommand/462

    Thread Starter Knut23

    (@knut23)

    Solved! Or well, sort of. The problem, indeed, seems to come from transparency and Imagick’s (in?)ability to handle it. I made some tests with saving the pdf’s in different ways and found that Optimizing the documents did the trick.
    The main problem is still there though. I could be wrong here but I guess settings in the pdf transparency handling scripts must be changed in WordPress core. That is if Imagick is able to do it at all…

    My versions
    ImageMagick: 6.9.10-22 Q16
    Ghostscript: 9.26

    If anyone wonder how the optimizing was done: Save As Other/Optimized PDF, check “Transparency”. Adobe Acrobat Pro DC was used.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your report and for all the work you put in to finding and “fixing” the problem.

    The link you posted to a sample document did not work for me – I got a 404 error. I’d be interested in testing with one of the failing documents if you can post another link that will let me download it.

    For now, I am marking this topic resolved because MLA is working properly and the problem has been traced to WordPress/Imagick. If I can reproduce your symptoms and find a better fix I will post an update here. Thanks again for your help and for your interest in the plugin.

    Thread Starter Knut23

    (@knut23)

    Hi!

    Yes I was a bit trigger happy in removing all the tested pdf’s. I will upload a new not-working pdf when I get back to work on Monday. Hopefully i remember…

    Have a nice weekend!
    Regards,
    Richard

    Thread Starter Knut23

    (@knut23)

    Link to not working pdf. Please reply when you have downloaded it.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for taking the time to supply a non-working PDF. I was able to access it, upload it to my test system and reproduce the problem you reported – a somber black “preview” page.

    I will investigate further and post an update here when I have something to report. Thanks again for your help.

    Thread Starter Knut23

    (@knut23)

    That’s more than I got. ?? I get no preview at all. No images are generated. All I see is the standard pdf icon.

    “I will investigate further and post an update here when I have something to report. Thanks again for your help.”

    Excellent! Thank YOU!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your patience while I worked through my backlog and found some time to work on this. I have discovered that the MLA Thumbnail Generation process works fine on the example file you provided. I would be very interested in knowing if that’s true on your system as well. Can you try this experiment and report your results?

    1. Navigate to the Media/Add New (Upload New Media) admin screen.
    2. Drag one of your “notworking.pdf” files to the “Drop files here” area.
    3. Check to see if the thumbnail generation in WordPress has failed. If so,
    4. Navigate to the Media/Assistant admin submenu.
    5. Check the box to the left of the bad item.
    6. Pull down the Bulk Actions dropdown, select “Thumbnail” and click “Apply”.
    7. Verify that the Type radio button is set to “WP”.
    8. Change the “Existing Items” dropdown to “Delete”
    9. Ignore the “-Thumbnail” value in the Suffix text box. It does not apply to WP thumbnails.
    10. Click “Generate Thumbnails”.
    11. Check the return message at the top of the screen and look for a thumbnail in the table.

    If this works for you, it’s a good workaround for the issue. I will also investigate further and see if I can apply the fix to the original upload process in some way.

    Thanks for your help!

    Plugin Author David Lingren

    (@dglingren)

    I have a new MLA Development Version with some fixes developed for this similar topic:

    Error thrown when generating WP thumb for PDF

    As I wrote earlier, I would be very interested to know if MLA thumbnail generation works for your problem document(s). Using the new Development Version would be best, but even the existing version might give me more information. Thanks for any additional information you can provide.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PDF thumbnail generation fails with error message’ is closed to new replies.