Thumbnails for PDF files

Hi, is it possible for Omeka to generate thumbnail preview from PDFs? I'm assuming "no" since this would require a postscript interpreter like ghostscript. That being the case, can I create these myself and make them available to Omeka afterwards?

I'm actually not really hopeful since I'm not sure how I'd map the generated thumbnails to the (random?) filesystem level names given to items in the Archive but I thought I'd ask.

I was thinking of creating the thumbnails using the technique described here: http://www.webvamp.co.uk/blog/coding/how-to-create-pdf-preview-images-in-php/

If your site is constructed so that there is one PDF for each Item, you could attach the thumbnail preview as an additional file. If, however, there are multiple PDFs for each Item, then yes, the mapping would be tricky

Is Omeka set-up now so that it should create thumbnails of PDFs (if ghostscript is present) including multiple-page PDFs?

I'm trying to decide if I should try to get this working on my host (Dreamhost which apparently does have ghostscript installed though I've not checked why/if it's not working) or if I would be better served by abandoning the idea and batch converting my PDFs to images. This means I lose the dirty OCR in the PDFs but I can live with that given its poor quality.

Omeka is not currently set up to create thumbs of PDFs. As Patrick suggested, you could upload a separate image file that would then represent the PDF. Then the Docs Viewer can be installed to make the PDFs readable.

If I create a (square?} thumbnail outside Omeka how do I name it and where would I place it for it to be recognized?

This might be a technical non-starter but can you show me where in the Omeka code the thumbnails are being created? Maybe I can just modify the code so that it does in fact create the thumbnail.

Any thumbnails, square thumbnails or "fullsize" images simply need to be placed in the corresponding directories under the archive directory, with the same name as the file they correspond to (but with a .jpg extension regardless of the original file's type). The files table has a column that records if any given file has thumbnails that would also need to be flipped from zero to one.

We've been doing some investigating into enabling support for Omeka to generate more thumbnails automatically. With the correct server setup, ImageMagick (which we currently use to generate the thumbnails) is able to handle PDFs as well as many other formats. The trick is setting things up so we can reliably detect which types of files the server can handle.

There are currently some other changes that would need to be made in Omeka to cause it to automatically use thumbnail images for non-image filetypes like PDFs. This will be an issue both for any expanded automatic thumbnail generation and for manually-created thumbnails.

Thank you very much, I'll try that out.

With some local tech help I've made further progress. Here's a howto in case someone else wants to go down this road as well.

To update the Omeka database so that it thinks it has thumbnails (here, from multi-page PDFs) I entered the following SQL command (in PHPMyAdmin after connecting to my Omeka MySQL database):

UPDATE omeka_file SET has_derivative_image=1;

I then generated my thumbnails with the maximum pixel dimension set in the Omeka preferences (200) with the following terminal command (this requires a current version of ghostscript and imagemagick - I used macports to install these on OSX):

for i in $(ls); do convert $i[0] -resize '200x200' ${i%.*}.jpg; done;

This assumes the PDF files (and nothing else) are in the current directory. As an aside, I initially tried to use the imagemagick mogrify command for the batch conversion but this didn't work properly for me with PDFs - at least I could not get it to work.

A final imagemagick oddity. I tried to use the same command to generate the full image size previews (maximum dimension 800 pixels by default) and found that imagemagick was rasterizing the PDF at 72dpi no matter what -density parameter I set. The results look terrible. No idea how to fix this. I haven't created the full size previews and as far as I can see the Thanks Roy theme doesn't need them.

Typo in the SQL command above, it should read:

UPDATE omeka_files SET has_derivative_image=1;

Also, you first need to select your database.

I see that this issue has been addressed by a patch to Omeka: https://github.com/omeka/Omeka/commit/e30777b6f0307732822bcad8f5f840a965ad883b

To find out in advance if imagemagick can produce thumbnails from your files use the identify command as described here: https://github.com/omeka/Omeka/issues/100

Can anyone tell me - does the advice above from John (and steps detailed by Arno) still hold true? I'm considering adding some custom thumbnails for ObjectVR files, and I would want to upload a different custom thumbnail for each individual item.

Just thought I'd ask before I jumped in. Thanks!