Next: Other Dired Features, Previous: Editing the Dired Buffer, Up: Dired, the Directory Editor [Contents][Index]
Image-Dired is a facility for browsing image files. It provides viewing the images either as thumbnails or in full size, either inside Emacs or through an external viewer. This is different from Image mode (see Viewing Image Files) for visiting an image file in the Emacs buffer.
To enter Image-Dired, mark the image files you want to look at in
the Dired buffer, using m as usual. Then type C-t d
(image-dired-display-thumbs
). This creates and switches to a
buffer containing Image-Dired, corresponding to the marked files.
You can also enter Image-Dired directly by typing M-x image-dired. This prompts for a directory; specify one that has image files. This creates thumbnails for all the images in that directory, and displays them all in the thumbnail buffer. The thumbnails are generated in the background and are loaded as they become available.
Image-Dired supports three methods of generating and storing
thumbnails, controlled by the value of the option
image-dired-thumbnail-storage
:
image-dired
This method stores thumbnails as JPEG images in a single directory
specified by the variable image-dired-dir
. This is the default.
The names of the thumbnail files are in this case constructed according
to the value of image-dired-thumb-naming
.
standard
standard-large
standard-x-large
standard-xx-large
These methods, mandated by the
Thumbnail Managing Standard, store thumbnails as PNG images
under the thumbnails subdirectory of the directory specified by
the environment variable XDG_CACHE_HOME
(which defaults to
~/.cache).
per-directory
This method stores the thumbnails of each directory in a .image-dired subdirectory of that directory, as jpeg images.
You can control the size of the thumbnail images by customizing the
variable image-dired-thumb-size
. The default is 128 pixels.
This variable is in effect only for the first and the third method of
thumbnail storage described above; the Thumbnail Managing Standard uses
fixed sizes determined by the method: standard
uses 128 pixels,
standard-large
256 pixels, etc. If you change the size after
some thumbnails were already created, you need to erase the thumbnail
files from their directory to have the new size take effect.
With point in the thumbnail buffer, you can type RET
(image-dired-display-this
) to display the image in another
window. Use the standard Emacs movement key bindings or the arrow
keys to move around in the thumbnail buffer. For easy browsing, use
SPC (image-dired-display-next
) to advance and display the
next image. Typing DEL (image-dired-display-previous
)
backs up to the previous thumbnail and displays that instead.
Type C-RET
(image-dired-thumbnail-display-external
) to display the image
in an external viewer. You must first configure
image-dired-external-viewer
.
You can delete images through Image-Dired also. Type d
(image-dired-flag-thumb-original-file
) to flag the image file
for deletion in the Dired buffer. Alternatively, you can remove an
image’s thumbnail from the thumbnail buffer without flagging the image
for deletion, by typing C-d (image-dired-delete-char
).
You could also use Image-Dired for “inline” operations (i.e.,
right into the Dired buffer). Type C-t C-t, and the thumbnails
of the selected images in Dired will appear in front of their names
(image-dired-dired-toggle-marked-thumbs
). C-t i and
C-t x will display the image under the point in Emacs or with
the external viewer, respectively.
More advanced features include image tags, which are metadata
used to categorize image files. The tags are stored in a plain text
file configured by image-dired-tags-db-file
.
To tag image files, mark them in the Dired buffer (you can also mark
files in Dired from the thumbnail buffer by typing m) and type
C-t t (image-dired-tag-files
). This reads the tag name
in the minibuffer. To mark files having a certain tag, type C-t f
(image-dired-mark-tagged-files
). After marking image files
with a certain tag, you can use C-t d to view them.
You can also tag a file directly from the thumbnail buffer by typing
t t, and you can remove a tag by typing t r. There is
also a special tag called “comment” for each file (it is not a tag
in the exact same sense as the other tags, it is handled slightly
differently). That is used to enter a comment or description about
the image. You comment a file from the thumbnail buffer by typing
c. You will be prompted for a comment. Type C-t c to add
a comment from Dired (image-dired-dired-comment-files
).
C-t e will bring a buffer to edit comment and tags
(image-dired-dired-edit-comment-and-tags
).
If you have the exiftool
program installed, you can set the
EXIF ‘ImageDescription’ tag of an image file by invoking
the image-dired-thumbnail-set-image-description
command with
point at the thumbnail of the image file. This command prompts for the
description of the image, and adds the EXIF tag to it.
Files that are marked in Dired will also be marked in Image-Dired if
image-dired-thumb-visible-marks
is non-nil
(which is the
default).
Image-Dired also provides simple image manipulation. In the
thumbnail buffer, type L to rotate the original image 90 degrees
anti clockwise, and R to rotate it 90 degrees clockwise. This
rotation is lossless, and uses an external utility called
jpegtran
, which you need to install first.
Next: Other Dired Features, Previous: Editing the Dired Buffer, Up: Dired, the Directory Editor [Contents][Index]