(defgroup image-dired nil
"Use dired to browse your images as thumbnails, and more."
:prefix "image-dired-"
+ :link '(info-link "(emacs) Image-Dired")
:group 'multimedia)
(defcustom image-dired-dir (locate-user-emacs-file "image-dired/")
"Directory where thumbnail images are stored."
- :type 'string
+ :type 'directory
:group 'image-dired)
(defcustom image-dired-thumbnail-storage 'use-image-dired-dir
(defcustom image-dired-db-file
(expand-file-name ".image-dired_db" image-dired-dir)
"Database file where file names and their associated tags are stored."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-temp-image-file
(expand-file-name ".image-dired_temp" image-dired-dir)
"Name of temporary image file used by various commands."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-gallery-dir
"Directory to store generated gallery html pages.
This path needs to be \"shared\" to the public so that it can access
the index.html page that image-dired creates."
- :type 'string
+ :type 'directory
:group 'image-dired)
(defcustom image-dired-gallery-image-root-url
"convert"
"Executable used to create thumbnail.
Used together with `image-dired-cmd-create-thumbnail-options'."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-create-thumbnail-options
:type 'string
:group 'image-dired)
-(defcustom image-dired-cmd-create-temp-image-program
- "convert"
+(defcustom image-dired-cmd-create-temp-image-program "convert"
"Executable used to create temporary image.
Used together with `image-dired-cmd-create-temp-image-options'."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-create-temp-image-options
"mogrify"
"Executable used to rotate thumbnail.
Used together with `image-dired-cmd-rotate-thumbnail-options'."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-rotate-thumbnail-options
"jpegtran"
"Executable used to rotate original image.
Used together with `image-dired-cmd-rotate-original-options'."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-rotate-original-options
(defcustom image-dired-temp-rotate-image-file
(expand-file-name ".image-dired_rotate_temp" image-dired-dir)
"Temporary file for rotate operations."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-rotate-original-ask-before-overwrite t
"exiftool"
"Program used to write EXIF data to image.
Used together with `image-dired-cmd-write-exif-data-options'."
- :type 'string
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-write-exif-data-options
(defcustom image-dired-cmd-read-exif-data-program
"exiftool"
"Program used to read EXIF data to image.
-Used together with `image-dired-cmd-read-exif-data-program-options'."
- :type 'string
+Used together with `image-dired-cmd-read-exif-data-options'."
+ :type 'file
:group 'image-dired)
(defcustom image-dired-cmd-read-exif-data-options
:type '(repeat string)
:group 'image-dired)
-(defcustom image-dired-thumb-size (if (eq 'standard image-dired-thumbnail-storage) 128 100)
+(defcustom image-dired-thumb-size
+ (if (eq 'standard image-dired-thumbnail-storage) 128 100)
"Size of thumbnails, in pixels.
This is the default size for both `image-dired-thumb-width'
and `image-dired-thumb-height'."
(defun image-dired-insert-image (file type relief margin)
"Insert image FILE of image TYPE, using RELIEF and MARGIN, at point."
-
(let ((i `(image :type ,type
:file ,file
:relief ,relief
"For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE."
(image-dired--check-executable-exists
'image-dired-cmd-create-thumbnail-program)
- (let* ((width (int-to-string image-dired-thumb-width))
- (height (int-to-string image-dired-thumb-height))
+ (let* ((width
+ (int-to-string (or (and (eq image-dired-thumbnail-storage 'standard) 128)
+ image-dired-thumb-width)))
+ (height
+ (int-to-string (or (and (eq image-dired-thumbnail-storage 'standard) 128)
+ image-dired-thumb-height)))
(modif-time (format "%.0f" (float-time (nth 5 (file-attributes
original-file)))))
(thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
(/ width
(+ (* 2 image-dired-thumb-relief)
(* 2 image-dired-thumb-margin)
- image-dired-thumb-width char-width))))
+ (or (and (eq image-dired-thumbnail-storage 'standard) 128)
+ image-dired-thumb-width)
+ char-width))))
(image-dired-line-up)))
(defun image-dired-line-up-interactive ()