9

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. Commented Nov 18, 2015 at 9:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.