• Resolved jeff.waite

    (@jeffwaite)


    I’ve been using your plugin for about a month with pdf’s and love it. Works great.

    But yesterday was the first time I had to add a .doc to my gallery.
    I made sure to check the “use google drive viewer” box in the settings, but when I upload my .doc I get the generic ‘word file type’ thumbnail.

    I know the plugin requires google drive viewer to generate office thumbnails– is there something else I need to do to make this work?
    Or is there a way I can test to see if the problem is with the plugin or google drive viewer?

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

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

    (@danrossiter)

    Hi Jeff,

    I’m sorry you’re having issues getting the fancy thumbnails for DOC files.

    There is a way to determine whether it’s an issue on Google’s end or the plugin. All you need to do is go here and enter the URL for the attachment that is failing. If it works there, then it’s an issue on our end.

    If it is an issue on our end (after doing the above test), if you could provide the same URL you input at the above link then we can analyze what we’re handling incorrectly.

    Thanks!
    -Dan

    Thread Starter jeff.waite

    (@jeffwaite)

    I can’t get to that link without signing into a google account first.

    Could that be the problem?

    Thread Starter jeff.waite

    (@jeffwaite)

    Nevermind– if I log out of google completely then the viewer is accessible without logging in. It’s the ‘timed out but not logged out’ limbo-ish state that forces you to log in.

    Anyways, it seems to work fine from what I can tell.
    https://docs.google.com/a/autobodyexpress.com/viewer?url=http://portal.autobodyexpress.com/wp-content/uploads/2013/10/LIMITED-WARRANTY.docx

    Plugin Author Dan Rossiter

    (@danrossiter)

    Thanks for following up, Jeff!

    I am not having an issue with the plugin generating a thumbnail for that DOCX on my test site.

    One possibility is that for whatever reason, generation failed the last time it was sent to Google, but would work if you re-upload and try again. I’ve had that happen specifically with the Google-reliant generation before. Could be for any number of reasons on Google’s end or in the network transit between your server and theirs.

    Would you mind re-uploading that attachment and trying to generate the thumbnail again? If the above is the reason then retrying should resolve.

    Thanks!
    -Dan

    Thread Starter jeff.waite

    (@jeffwaite)

    I deleted the file and reuploaded it. I still don’t get a thumbnail for the file.

    You mention re-uploading and trying to generate the thumbnail– do you mean to say that this is two different processes?

    The pdf files get thumbnails at the time of upload. Is it different for the office file types?

    I just want to make sure I’m not misunderstanding the process for generating thumbnails– is there a manual way to force thumbnail generation?

    Plugin Author Dan Rossiter

    (@danrossiter)

    Hi Jeff,

    The current thumbnail generation flow doesn’t create a thumbnail until the first time the attachment in question is viewed within a document gallery. The first time a page/post containing a gallery which contains that attachment is viewed, the thumbnail will be generated. The only exception to this is that when a lot of thumbnails need to be generated for a single gallery, that generation may be split up into multiple page views, meaning that default file type icons will be rendered for attachments lower in the gallery, which will be generated on future page loads.

    Does that make sense?

    It’s also worth noting that you will not be able to generate thumbnails for Google-reliant filetypes if you are not on a public IP (for example, if you are running a local test server).

    -Dan

    Thread Starter jeff.waite

    (@jeffwaite)

    Gotcha.

    That all makes sense but I still don’t get a thumbnail. I’ve deleted the file several times and reuploaded and then done multiple refreshes on the page where the document gallery is displayed. All my pdf’s thumbnails are correct but my .doc is still the generic thumbnail.

    My site requires a login to view any pages but direct links to attachments are not locked behind any authentication.
    Does your plugin require google be able to talk to the page itself (if that makes sense) or does it just need a publicly accessible url for the attachment?

    If I understand correctly, pdf thumbnails are generated using ghostscript running ‘locally’ from the webserver.

    This seems like the key difference in my scenario for thumbnail generation– if google attempts to talk to a script running on the page it might get met by a login redirect which would cause google docs thumbnail generation to fail, but since ghostscript runs locally it doesn’t need to ‘go outside’ and hit the auth redirect.

    Sound plausible?

    Plugin Author Dan Rossiter

    (@danrossiter)

    Thanks for the additional info, Jeff!

    Yes, that scenario sounds very likely given that generation is succeeding when the file is fed directly to Google. It *shouldn’t* be an issue though if direct access to the files is not blocked with your setup.

    How exactly is your login being enforced? Are you using some third-party plugin or general WP settings? I’d like to try and reproduce the setup you have to see if I can figure out exactly where the stumbling block is.

    Thanks!
    -Dan

    Thread Starter jeff.waite

    (@jeffwaite)

    We’ve been using this plugin, which I see now hasn’t been updated in a long time, but it’s been working for us without issue.

    As a test I disabled the plugin, confirmed that I could access the site without logging in, and then deleted and re-uploaded the file, and checked the page with the document gallery– however still no thumbnail. I did several refreshes and viewed in several browsers to confirm.

    So I don’t believe the plugin is preventing google from generating the thumbnail.

    Is there a folder on the server where thumbnails are cached that could watch to try to find the issue? Does the plugin generate a log when it generates thumbnails?
    I poked around the plugin\document-gallery folder but didn’t see anything interesting.

    Thread Starter jeff.waite

    (@jeffwaite)

    Also, I’m curious– is thumbnail generation tied to uploading at all?

    Meaning, is unattaching the file from the page and then reattaching it the same as deleting the file and reuploading and attaching it to the page, as far as document gallery is concerned?

    I only ask as it would save me a few steps in troubleshooting to simply unattach then reattach instead of deleting and reuploading each time.
    Just curious!

    Plugin Author Dan Rossiter

    (@danrossiter)

    Thanks for the plugin link, on brief inspection I would agree that it is unlikely to be the cause. I’ll still install on a test instance just to verify.

    The thumbnails are generated in the same directory as the parent of the attachment they are related to, so you’ll want to look in uploads to find any existing thumbnails.

    In terms of logging, this current version is quite clunky, but we have a version in development that will make things *much* easier. Unfortunately, in the meantime, you’ll need to first enable WP_DEBUG, then somehow view the PHP error log, filtering on messages prefixed by “DG”. Some third-party plugins exist to view the PHP error log, or you can remote into your server and view the log directly if you are comfortable with that approach. If you can retrieve the log entries generated after re-uploading the file in question and viewing a gallery that it is included in, that would be extremely helpful in narrowing down what is happening.

    Addressing the second question, the thumbnail generation is lazy to avoid unnecessary strain on the server in terms of both compute power and disk space. We don’t want to be generating thumbnails for attachments that will never make it into a document gallery, so until a gallery containing the attachment is viewed, no work is done by DG. In terms of deleting, a true delete is required since behind the scenes a thumbnail is linked to an attachment rather than a post/page (this allows for referencing attachments from multiple pages/posts without needing multiple duplicate thumbnails).

    All the best!
    -Dan

    Plugin Author Dan Rossiter

    (@danrossiter)

    Just an update regarding the description of logging above:

    Logging no longer requires an external plugin or messing with WP_DEBUG. Just navigate to Dashboard -> Settings -> Document Gallery -> Advanced tab and check the enable logging box.

    -Dan

    Thread Starter jeff.waite

    (@jeffwaite)

    Thanks Dan.
    I haven’t had a chance to look into this further since last we talked.

    I’ll take a look ASAP and let you know what I find.

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

The topic ‘.doc thumbnails not working’ is closed to new replies.