• Resolved arabesco

    (@arabesco)


    Hi David,
    since WordPress started generating thumbnails for pdf documents I have found problems with my mla_gallery. I explicitly specify the thumbnail height and width as such:
    ... columns=4 mla_viewer=true mla_viewer_height=150 mla_viewer_width=150 mla_viewer_resolution=100 ...

    For jpeg or pdf documents loaded until about December 2016, I am getting the correct 150 pixel size in height and width, while pdf (not jpeg) documents loaded after that time are displayed at 150px in width but at a different height, proportioned to the original document height.
    I believe the pdf thumbnail image is no longer generated in real time by the viewer but rather stored by WordPress at document load time.
    I have tried clearing the checkboxes
    Enable Featured Images and
    Enable Featured Image Generation
    in the Administrator/Shortcodes tab, but I don’t notice any change.

    I have also tried adding the specification
    mla_viewer_best_fit=true
    to my mla_gallery shortcode but this makes things worse, as even older documents get displayed with proportional height.

    NOTE (relevant?).
    In the Administrator/Shortcodes tab, I am now getting a warning about Ghostscript not beng present in the Linux virtual server (the check did find gs in the past). My web provider has stated that Ghostscript is available, but they won’t disclose the absolute path for security reasons, and said I should clear the check from
    Enable explicit Ghostscript check
    In fact only if I do clear it (thus avoiding checking) I can get the thumbnail generation by the mla_viewer to work for old pdf documents. Old jpeg are not affected.

    To summarize: Without an “Explicit Ghostscript check”, the mla_viewer creates thumbnails for old (2016 and earlier) pdf at 150×150, and it does not get involved for new (2017) pdfs, which are displayed at 150xSomething. All jpegs are OK.
    With the “Explicit Ghostscript check”, the mla_viewer fails to create any old pdf thumbnails, and new pdf are displayed at at 150xSomething. All jpegs are OK.

    My goal is to control height even for new PDFs. What can I do?
    Guido

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

    (@dglingren)

    Thanks for your report and especially for all the details you have provided; very helpful.

    Your suspicion is correct; WordPress now generates native thumbnails for PDF documents as described in this blog post:

    Enhanced PDF Support in WordPress 4.7

    My goal for MLA is to be as WordPress-like as possible, so I made the decision to honor the new native thumbnails and never override them with MLA’s own generated thumbnails or Featured Images. In the current MLA version there is no option to alter this decision.

    You make a reasonable case for changing my decision and introducing an option to ignore the native thumbnails. If I pursue that development would you be willing to install an MLA test version and help test it out?

    I am happy to see, by the way, that the “Explicit Ghostscript check” override proved useful.

    I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.

    Thread Starter arabesco

    (@arabesco)

    Hi David,
    sorry for my delay in replying.
    I am surprised that controlling thumbnail height is only a concern of mine, because the resulting multicolumn display gets rather messy without it.

    Of course I am more than willing to install and test a future version addressing the issue we are discussing.
    Thanks for your support,
    Guido

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your response and your willingness to help test a possible enhancement. I believe more control over the PDF thumbnail handling will benefit other MLA users as well. I will post an update here when I have progress to report.

    Plugin Author David Lingren

    (@dglingren)

    I have uploaded a new MLA Development Version dated 20170428 that contains the enhancement you inspired. Once you have installed the Development Version you can change your mla_viewer=true parameter to mla_viewer=true,required to bypass the WordPress native PDF thumbnails and generate the square 150×150 images you desire.

    It would be great if you installed the new version and let me know how it works for you. To get it, click this link to download the Development Version ZIP archive:

    https://downloads.wordpress.org/plugin/media-library-assistant.zip

    Once you have the ZIP archive on your system:

    1. Login to your site’s Admin area and navigate to Plugins/Installed Plugins.
    2. Find Media Library Assistant and deactivate it.
    3. Find Media Library Assistant and delete it. You will not lose any settings.
    4. Go to Plugins/Add New.
    5. Click “Upload Plugin”, to the right of the Add Plugins title.
      “Browse…” to the location of the ZIP Archive and click on it.
    6. Click “Install Now”, to the right of “Browse…”
    7. When the install completes, click “Activate Plugin” at the bottom of the screen.
    8. When the activation completes, go back to the Plugins/Installed Plugins screen.
    9. Scroll down to “Media Library Assistant” and look for a date like “2017-428” at the start of the Description. That’s how you know you have a Development Version. You can also go to the Settings/Media Library Assistant submenu and see the date stamp in the heading.

    That’s it. I don’t change the version number of the Development Version, so you will be notified when the next official version comes out and the normal update process will continue to work.

    Thread Starter arabesco

    (@arabesco)

    Hallo David,
    thank you for your effort to accomodate my needs.

    I have downloaded installed and activated the new Development Version.
    I have tried it on my test site, and by specifying mla_viewer=true,required in the mla_gallery Shortcode, I get the mla_viewer to generate thumbnails of the desired width and height even for “new” PDF that have associated WordPress thumbnails.

    However I found a side effect that alters an established behaviour.
    My mla_gallery shortcode includes a
    link=file mla_target="_blank"
    specification, that used to generate a hyperlink direct to the PDF (or JPEG) contents in a new browser tab.
    Now the same specification, whether for “old” or “new” PDFs, takes to an intermediate page, I believe you call it the “media page”, from which the actual PDF can be opened or downloaded. JPEGs are not affected, they still go direct to the image display page.
    For example, form the displayed gallery, when I click on a generated thumbnail for mydoc.pdf my new tab opens at
    http://mysite/myroot/mydoc/ (the permalink)
    instead of going direct to the file URL
    http://mysite/myroot/wp-content/uploads/year/month/mydoc.pdf
    which would be my preferred link.

    Can you please suggest how can this be fixed?
    Thanks again for your support,
    Guido

    Plugin Author David Lingren

    (@dglingren)

    Thanks for trying the new Development Version and reporting your results.

    The “side effect that alters an established behaviour” is a defect I introduced in the update.

    I have uploaded a new Development Version dated 20170502 that corrects the problem. It would be great if you could install it and verify that it works for you.

    Thread Starter arabesco

    (@arabesco)

    OK, everything is working with the new development version, as far as I can tell.

    Thank you for your support and all the good work you have put into this enhancement.
    Guido

    Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming the fix the new version and for your kind words. Thanks as well for the positive review you posted. Reviews and positive feedback are great motivators to keep working on the plugin and supporting its users.

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

The topic ‘Thumbnail height in mla_gallery’ is closed to new replies.