Thumbnail image/icon for pdfs

I’ve uploaded a bunch of pdfs but I would like there to be an image icon for each (perhaps the first page of the document) instead of the blank paper icon with a folded corner. Is there a setting or change of the way I am uploading them (I do have individual jpgs of each page) to achieve this? Or where in the code should I look and maybe place a link to a jpg of the first page?
Thanks,
J

If you upload a .jpg and place it first in the list of files (you can reorder them on the item edit form), S will use that as the thumbnail for the item.

Omeka S can also just generate thumbnails from PDFs directly, and that’s what it will automatically do. If your install isn’t doing that, it probably just means your server is missing some piece of software it needs to make those thumbnails. Generally just having ImageMagick and Ghostscript installed is sufficient. If you’re using the “GD” thumbnailer you definitely won’t get PDF thumbnails generated.

Ah thanks! I had tried the additional jpg before and it didn’t seem to work but it is now. Thanks for the information about the server - it is not generating the thumbnails for the pdfs so I will need to look into that.
THANK YOU

Hi there!
I have the same problem. No pdf thumbnail image generated, but I have installed imagemagick and ghostscript.
My question is: How can I find out what piece of software my server is missing for the pdf thumbnail generation to work?

Update: I don’t think there’s something mission on my server

Please check out this error I got from application.log:

2019-01-11T09:08:40+00:00 ERR (3): Command "/usr/bin/convert -density 150 '/tmp/omekaCCTAuI[0]' -auto-orient -background white +repage -alpha remove -thumbnail '800x800>' '/tmp/omekajXlRwH.jpg'" failed with status code 1.

Omeka S v1.3 has solved this issue with a new thumbnail tab. This tab is available for items, itemsets, and media files. It is awesome!

Hi,

I am having exactly the same error on my server with both imagemagick and ghostscript installed, see below :
2019-05-28T14:28:37+00:00 ERR (3): Command "/usr/bin/convert -density 150 '/tmp/omekaOWYsk3[0]' -auto-orient -background white +repage -alpha remove -thumbnail '800x800>' '/tmp/omekaa23Kz7.jpg'" failed with status code 1.

I am using OMEKA S v1.4 and nothing has been solved because, to answer @mrPositiveEnergy, the thumbnails tab offers to add a thumbnail from your own files or sites media but not from the media attached to my content. Moreover, I want my thumbnail to be automatically generated when imported.

If anyone has solved this issue, It would be awesome to share it with the community :slight_smile:

Do all thumbnails not work for you, or just those of PDFs?

If it’s just PDFs, the easiest test is generally to ssh to your server and try to run convert or identify on a PDF of your choosing and see what happens. Some distributions currently disable PDF conversion by ImageMagick by default, as one example of what could be your issue.

Hi,
Thank you for your answer.

It is not working but only for PDFs.
Following your advice, I imported a PDF on my server and tried to convert it using plain command line.

Here is the command I tried :

/usr/bin/convert -density 150 ‘test-for-omeka.pdf[0]’ -auto-orient -background white +repage -alpha remove -thumbnail ‘800x800>’ 'preview.jpg

I tried to stick close to the command launched by Omeka S.

Here is my result :

convert: not authorized test-for-omeka.pdf' @ error/constitute.c/ReadImage/412. convert: no images definedpreview.jpg’ @ error/convert.c/ConvertImageCommand/3210.

So, I googled it and found the solution here : https://stackoverflow.com/questions/42928765/convertnot-authorized-aaaa-error-constitute-c-readimage-453

I finally modified the /etc/ImageMagick-6/policy.xml to comment the line where it was forbidden to interact with PDF :
<!-- <policy domain="coder" rights="none" pattern="PDF" /> -->

Now it works on OMEKA S ! :slight_smile:

Thank you for leading me to the right direction.
Vincent.