Support » Plugin: Media Library Assistant » Problem and suggestion regarding thumbnails (from pdf) and Ghostscript

  • My problem right now is that my web hotel doesn’t have Ghostscript installed. I spoke to them and it seems they are not going to install it very soon/at all either.

    Does anyone out there have a suggestion on how to get pdf thumbnails without Ghostscript and by not having to do them manually?

    And now to my suggestion: My web hotel does have Imagick (more common maybe?). And during my trials and errors with document handling in WordPress I stumbled on a plugin called Document gallery. This plugin generates thumbnails with the help of Imagick without Ghostscript. So, this leads to my suggestion. As I understand, there are advantages to use Ghostscript before/or in combination with Imagick. But if Ghostscript is not available, why not let the user choose to just use Imagick. As is done in Document gallery.

    https://wordpress.org/plugins/media-library-assistant/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your questions and suggestions. The relationships between the various components of the “PDF Thumbnail” solution can be confusing. This earlier topic is along the same lines:

    Featured Image for mla_viewer

    To summarize, my understanding is:

    • Imagick is a PHP extension that provides access to Imagemagick
    • Imagemagick provides lots of image-processing functions such as scaling and format conversion
    • Imagemagick uses Ghostscript to convert PDF and Postscript files to an image format such as JPEG or PNG

    Without Ghostscript, Imagemagick does not process PDF files. If Document Gallery is working at your web hosting server, you have Ghostscript. I do not know why you were told otherwise.

    The Document Gallery plugin uses Imagick, Imagemagick and Ghostscript to process PDF files. I have worked with this plugin and inspected its source code. If you look at the Document Gallery FAQ page you will see:

    Q: Why is Ghostscript so much faster than Imagick?

    A: This comes down to how the two programs work. Imagick actually delegates handling of PDFs to Ghostscript behind the scenes, but it doesn’t do so intelligently.

    I hope that clears up any confusion. If you really are generating PDF thumbnails on a system without Ghostscript I would be very interested in more details so I can learn from your experience. Thanks for taking the time to look into this.

    Another way I’ve generated PDF thumbnails in the past is with Adobe Illustrator, but that’s a manual solution. I have also installed Ghostscript on my Windows PC and used that – another manual solution.

    Plugin Author David Lingren

    (@dglingren)

    I have uploaded a new MLA Development Version dated 20150625 that includes a new “Thumbnail Generation” capability. The Media/Assistant “Thumbnail” Bulk Action lets you select one or more non-image items and generate new thumbnail image items you can use as the Featured Image for those items. That lets mla_viewer display the thumbnails without re-generating them each time the gallery is composed. You can find step-by-step instructions for using the Development Version in this earlier topic:

    MLA errors when using plugin

    I am very interested in feedback on this new feature. If you get a chance to try the Development Version please let me know how it works for you. Thanks for your interest in the plugin.

    Thread Starter Knut23

    (@knut23)

    Hi David!

    Thanks for keeping the thread going!!! Sorry for not getting back to your questions above. I have not had any spare time to do any testing until now. Also I had uninstalled the Document gallery-plugin and on top of that I lost my testing server. Anyhow, this is now redundant! 😉
    I have tried the new thumbnail generation and I can confirm that it works. Not just works, it works excellent! Did not try all the alternatives though.
    Options tried:
    Width, Height, Best Fit and combinations of the same.
    Existing Items: Keep, Trash, Delete
    Tried on both single and multiple items (pdf’s)
    Clear Filter-by checked/unchecked (I am not sure what this does though. Both checked and unchecked takes me to the same view after thumbnail generation: The “Media Library Assistant – Generated Thumbnails”-page with empty document list. Regardless if I had filtered the files before or not).

    Hope this will help and that this feature finds it’s way to the production version soon!

    Thank you very much!
    Regards,
    Richard

    Plugin Author David Lingren

    (@dglingren)

    Thanks for taking the time to try out the Development Version and give your detailed comments; very helpful.

    Your “empty document list” result is exactly what the “Clear Filter-by” option is designed to prevent, and I agree that the purpose of this option isn’t obvious. The “Generated Thumbnails” screen is supposed to list the items representing the generated thumbnail images so you can bulk/quick edit them with any additional changes you want to make. The empty list isn’t very helpful!

    Can you tell me how you select the documents to generate thumbnails for? For example, do you enter some keywords in the Search Media box, or use the year/month or terms dropdown controls or some other filter? Can you tell me what “view” (to the left of the Search Media box) is bolded before and after generation?

    I am considering removing the “Clear Filter-by” option and just clearing all of the filters and views so the generated items will appear but I want to make sure there isn’t some other bug before I do that.

    I am also pondering whether to copy the assigned taxonomy terms from the document to the thumbnail. Do you have a preference on that?

    Thanks for your help!

    Thread Starter Knut23

    (@knut23)

    “Your “empty document list” result is exactly what the “Clear Filter-by” option is designed to prevent, and I agree that the purpose of this option isn’t obvious.”
    Well, then I guessed it right! 😉

    “Can you tell me how you select the documents to generate thumbnails for?”
    They were selected by filtering on a specific “att. category”.

    “Can you tell me what “view” (to the left of the Search Media box) is bolded before and after generation?”
    During my trials it has been “All”. Both before and after. When I select a different view, for example “Applications”. It returns to “All” after thumbnail generation.

    I now tried by manually selecting documents, both single and multiple. Result with “Clear by” checked/unchecked: Message saying which thumbnail/s was generated AND the list with thumbnail/s showing with options to edit delete and so on.

    Also, all my edits have been done with the default suffix. Probably has got nothing to do with it, but just so you know.

    “I am also pondering whether to copy the assigned taxonomy terms from the document to the thumbnail. Do you have a preference on that?”
    I am not sure. I might bee way off here (haven’t really tried the tag cloud option yet), but couldn’t that mess up tag clouds, for example? I don´t see a scenario where I want to show my thumbnails, except as a link/preview to/for the document. But there’s probably a billion other uses/work flows out there… If it’s an easy thing to do, why not make it optional (with default set to not to add the terms)?

    Hope this helps you out. Thanks for hard work!
    Regards,
    Richard

    Plugin Author David Lingren

    (@dglingren)

    Thank you for your response and comments on the points I raised; very helpful.

    After reviewing your comments and thinking things over I have removed the “Clear Filter-by” option from the form; it is now unconditional. I have also added logic to reset the Year/Month and Att. Categories (taxonomy filter) dropdown controls as well as the Search Media box. The list of generated thumbnail items should now appear regardless of how you select the original PDF items to work on.

    I have uploaded a new Development Version dated 20150702 with changes based on your feedback. It would be great if you can take the time to test the new version and let me know what you think of the new rules.

    Regarding the “copy the assigned taxonomy terms” question, I agree that it has consequences for tag clouds and so forth. For now, I will leave it out, because you can always Quick/Bulk edit the thumbnail items and assign terms if you want them.

    Thanks for your help and comments.

    Thread Starter Knut23

    (@knut23)

    Hi again David!

    Thumbnail generation still works fine! 😉 After generation, the list of generated thumbnails comes up. Both a list in the info box (mla_messages) in the page top and a list of thumbnails ready to be edited. The drop down for choosing Categories reverts to “All Att. Categories”. There is also a button “Clear Filter-by” (is this new, cant remember I’ve seen it). This button seems to do nothing, except removing the info box. Correct behavior?

    A heads up. I will be, more or less, off the grid for a month now. So there is a risk that I can’t reply or test any more for a while now. I might be able to get to a computer during weekends though. Sorry!

    Thanks!
    /Richard

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your latest round of testing and feedback. Reverting the Att. Categories dropdown is correct; that’s required to let the list of thummbnails show up in the submenu table.

    I will have a look at the Clear Filter-by button; it may not make sense to show it in this case.

    Enjoy your time off the grid; I hope it’s an adventure! Thanks again for all your help testing out this new MLA feature.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problem and suggestion regarding thumbnails (from pdf) and Ghostscript’ is closed to new replies.