8

If I select image files in a Dired buffer and do C-t C-t, a nice little thumbnail appears. But if I try this with PDF files, nothing happens. I would expect to see a thumbnail of the first page of the PDF.

Is this normal? Is there an easy way to get the behavior I want? (I am running Emacs 24.3.1 on Ubuntu 14.04 if that matters.)

1 Answer 1

3

This is a feature of dired+ as far as I can tell. C-t C-t is bound to image-dired-dired-toggle-marked-thumbs, which first checks whether the file is an image or not with diredp-get-image-filename. This procedure runs image-file-name-regexp to generate a regular expression matching all image file names. Then it creates thumbnails with Imagemagick's convert (defined in image-dired-cmd-create-thumbnail-program).

You should be able to modify the behaviour of image-file-name-regexp by adding a regular expression for PDF files to the variable image-file-name-regexps. convert can convert PDF files to images, so you should get a thumbnail.

1
  • 1
    Thanks for the helpful info. I'm afraid this might require a defadvice then. convert treat PDFs differently than other images, generating a numbered image for each page in the file. Unless there is a way to modify image-dired-cmd-create-thumbnail-program so that it would do something like convert file.pdf[0], but that may cause problems with regular images.
    – Brian Z
    Nov 18, 2015 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.