diff options
| author | Mark Oteiza | 2016-12-15 13:25:08 -0500 |
|---|---|---|
| committer | Mark Oteiza | 2016-12-15 13:25:08 -0500 |
| commit | d79ff2a4b9b9096866168a569ec45df15e29288c (patch) | |
| tree | 8a2818a39de51ccdad54a72171a87261f9e5836d | |
| parent | 4fbda463dca50f630c31a2602bd34849f4b51e51 (diff) | |
| download | emacs-d79ff2a4b9b9096866168a569ec45df15e29288c.tar.gz emacs-d79ff2a4b9b9096866168a569ec45df15e29288c.zip | |
Fix some image-dired customization types
* lisp/image-dired.el (image-dired): Add info link to defgroup.
(image-dired-dir, image-dired-gallery-dir): Set type to directory.
(image-dired-db-file, image-dired-temp-image-file):
(image-dired-cmd-create-thumbnail-program):
(image-dired-cmd-create-temp-image-program):
(image-dired-cmd-rotate-thumbnail-program):
(image-dired-cmd-rotate-original-program):
(image-dired-temp-rotate-image-file):
(image-dired-cmd-write-exif-data-program):
(image-dired-cmd-read-exif-data-program): Set type to file.
(image-dired-create-thumb, image-dired-line-up-dynamic): Check storage
type at runtime, since setting image-dired-thumb-size does not
automatically set image-dired-thumb-width and image-dired-thumb-height.
| -rw-r--r-- | lisp/image-dired.el | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index a23dbfead7e..86e34324029 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -160,11 +160,12 @@ | |||
| 160 | (defgroup image-dired nil | 160 | (defgroup image-dired nil |
| 161 | "Use dired to browse your images as thumbnails, and more." | 161 | "Use dired to browse your images as thumbnails, and more." |
| 162 | :prefix "image-dired-" | 162 | :prefix "image-dired-" |
| 163 | :link '(info-link "(emacs) Image-Dired") | ||
| 163 | :group 'multimedia) | 164 | :group 'multimedia) |
| 164 | 165 | ||
| 165 | (defcustom image-dired-dir (locate-user-emacs-file "image-dired/") | 166 | (defcustom image-dired-dir (locate-user-emacs-file "image-dired/") |
| 166 | "Directory where thumbnail images are stored." | 167 | "Directory where thumbnail images are stored." |
| 167 | :type 'string | 168 | :type 'directory |
| 168 | :group 'image-dired) | 169 | :group 'image-dired) |
| 169 | 170 | ||
| 170 | (defcustom image-dired-thumbnail-storage 'use-image-dired-dir | 171 | (defcustom image-dired-thumbnail-storage 'use-image-dired-dir |
| @@ -186,13 +187,13 @@ that allows sharing of thumbnails across different programs." | |||
| 186 | (defcustom image-dired-db-file | 187 | (defcustom image-dired-db-file |
| 187 | (expand-file-name ".image-dired_db" image-dired-dir) | 188 | (expand-file-name ".image-dired_db" image-dired-dir) |
| 188 | "Database file where file names and their associated tags are stored." | 189 | "Database file where file names and their associated tags are stored." |
| 189 | :type 'string | 190 | :type 'file |
| 190 | :group 'image-dired) | 191 | :group 'image-dired) |
| 191 | 192 | ||
| 192 | (defcustom image-dired-temp-image-file | 193 | (defcustom image-dired-temp-image-file |
| 193 | (expand-file-name ".image-dired_temp" image-dired-dir) | 194 | (expand-file-name ".image-dired_temp" image-dired-dir) |
| 194 | "Name of temporary image file used by various commands." | 195 | "Name of temporary image file used by various commands." |
| 195 | :type 'string | 196 | :type 'file |
| 196 | :group 'image-dired) | 197 | :group 'image-dired) |
| 197 | 198 | ||
| 198 | (defcustom image-dired-gallery-dir | 199 | (defcustom image-dired-gallery-dir |
| @@ -200,7 +201,7 @@ that allows sharing of thumbnails across different programs." | |||
| 200 | "Directory to store generated gallery html pages. | 201 | "Directory to store generated gallery html pages. |
| 201 | This path needs to be \"shared\" to the public so that it can access | 202 | This path needs to be \"shared\" to the public so that it can access |
| 202 | the index.html page that image-dired creates." | 203 | the index.html page that image-dired creates." |
| 203 | :type 'string | 204 | :type 'directory |
| 204 | :group 'image-dired) | 205 | :group 'image-dired) |
| 205 | 206 | ||
| 206 | (defcustom image-dired-gallery-image-root-url | 207 | (defcustom image-dired-gallery-image-root-url |
| @@ -223,7 +224,7 @@ expects to find pictures in this directory." | |||
| 223 | "convert" | 224 | "convert" |
| 224 | "Executable used to create thumbnail. | 225 | "Executable used to create thumbnail. |
| 225 | Used together with `image-dired-cmd-create-thumbnail-options'." | 226 | Used together with `image-dired-cmd-create-thumbnail-options'." |
| 226 | :type 'string | 227 | :type 'file |
| 227 | :group 'image-dired) | 228 | :group 'image-dired) |
| 228 | 229 | ||
| 229 | (defcustom image-dired-cmd-create-thumbnail-options | 230 | (defcustom image-dired-cmd-create-thumbnail-options |
| @@ -237,11 +238,10 @@ which is replaced by the file name of the thumbnail file." | |||
| 237 | :type 'string | 238 | :type 'string |
| 238 | :group 'image-dired) | 239 | :group 'image-dired) |
| 239 | 240 | ||
| 240 | (defcustom image-dired-cmd-create-temp-image-program | 241 | (defcustom image-dired-cmd-create-temp-image-program "convert" |
| 241 | "convert" | ||
| 242 | "Executable used to create temporary image. | 242 | "Executable used to create temporary image. |
| 243 | Used together with `image-dired-cmd-create-temp-image-options'." | 243 | Used together with `image-dired-cmd-create-temp-image-options'." |
| 244 | :type 'string | 244 | :type 'file |
| 245 | :group 'image-dired) | 245 | :group 'image-dired) |
| 246 | 246 | ||
| 247 | (defcustom image-dired-cmd-create-temp-image-options | 247 | (defcustom image-dired-cmd-create-temp-image-options |
| @@ -311,7 +311,7 @@ with the information required by the Thumbnail Managing Standard." | |||
| 311 | "mogrify" | 311 | "mogrify" |
| 312 | "Executable used to rotate thumbnail. | 312 | "Executable used to rotate thumbnail. |
| 313 | Used together with `image-dired-cmd-rotate-thumbnail-options'." | 313 | Used together with `image-dired-cmd-rotate-thumbnail-options'." |
| 314 | :type 'string | 314 | :type 'file |
| 315 | :group 'image-dired) | 315 | :group 'image-dired) |
| 316 | 316 | ||
| 317 | (defcustom image-dired-cmd-rotate-thumbnail-options | 317 | (defcustom image-dired-cmd-rotate-thumbnail-options |
| @@ -329,7 +329,7 @@ of the thumbnail file." | |||
| 329 | "jpegtran" | 329 | "jpegtran" |
| 330 | "Executable used to rotate original image. | 330 | "Executable used to rotate original image. |
| 331 | Used together with `image-dired-cmd-rotate-original-options'." | 331 | Used together with `image-dired-cmd-rotate-original-options'." |
| 332 | :type 'string | 332 | :type 'file |
| 333 | :group 'image-dired) | 333 | :group 'image-dired) |
| 334 | 334 | ||
| 335 | (defcustom image-dired-cmd-rotate-original-options | 335 | (defcustom image-dired-cmd-rotate-original-options |
| @@ -347,7 +347,7 @@ original image file name and %t which is replaced by | |||
| 347 | (defcustom image-dired-temp-rotate-image-file | 347 | (defcustom image-dired-temp-rotate-image-file |
| 348 | (expand-file-name ".image-dired_rotate_temp" image-dired-dir) | 348 | (expand-file-name ".image-dired_rotate_temp" image-dired-dir) |
| 349 | "Temporary file for rotate operations." | 349 | "Temporary file for rotate operations." |
| 350 | :type 'string | 350 | :type 'file |
| 351 | :group 'image-dired) | 351 | :group 'image-dired) |
| 352 | 352 | ||
| 353 | (defcustom image-dired-rotate-original-ask-before-overwrite t | 353 | (defcustom image-dired-rotate-original-ask-before-overwrite t |
| @@ -361,7 +361,7 @@ original file with `image-dired-temp-rotate-image-file'." | |||
| 361 | "exiftool" | 361 | "exiftool" |
| 362 | "Program used to write EXIF data to image. | 362 | "Program used to write EXIF data to image. |
| 363 | Used together with `image-dired-cmd-write-exif-data-options'." | 363 | Used together with `image-dired-cmd-write-exif-data-options'." |
| 364 | :type 'string | 364 | :type 'file |
| 365 | :group 'image-dired) | 365 | :group 'image-dired) |
| 366 | 366 | ||
| 367 | (defcustom image-dired-cmd-write-exif-data-options | 367 | (defcustom image-dired-cmd-write-exif-data-options |
| @@ -377,8 +377,8 @@ which is replaced by the tag value." | |||
| 377 | (defcustom image-dired-cmd-read-exif-data-program | 377 | (defcustom image-dired-cmd-read-exif-data-program |
| 378 | "exiftool" | 378 | "exiftool" |
| 379 | "Program used to read EXIF data to image. | 379 | "Program used to read EXIF data to image. |
| 380 | Used together with `image-dired-cmd-read-exif-data-program-options'." | 380 | Used together with `image-dired-cmd-read-exif-data-options'." |
| 381 | :type 'string | 381 | :type 'file |
| 382 | :group 'image-dired) | 382 | :group 'image-dired) |
| 383 | 383 | ||
| 384 | (defcustom image-dired-cmd-read-exif-data-options | 384 | (defcustom image-dired-cmd-read-exif-data-options |
| @@ -397,7 +397,8 @@ Used by `image-dired-gallery-generate' to leave out \"hidden\" images." | |||
| 397 | :type '(repeat string) | 397 | :type '(repeat string) |
| 398 | :group 'image-dired) | 398 | :group 'image-dired) |
| 399 | 399 | ||
| 400 | (defcustom image-dired-thumb-size (if (eq 'standard image-dired-thumbnail-storage) 128 100) | 400 | (defcustom image-dired-thumb-size |
| 401 | (if (eq 'standard image-dired-thumbnail-storage) 128 100) | ||
| 401 | "Size of thumbnails, in pixels. | 402 | "Size of thumbnails, in pixels. |
| 402 | This is the default size for both `image-dired-thumb-width' | 403 | This is the default size for both `image-dired-thumb-width' |
| 403 | and `image-dired-thumb-height'." | 404 | and `image-dired-thumb-height'." |
| @@ -538,7 +539,6 @@ Create the thumbnails directory if it does not exist." | |||
| 538 | 539 | ||
| 539 | (defun image-dired-insert-image (file type relief margin) | 540 | (defun image-dired-insert-image (file type relief margin) |
| 540 | "Insert image FILE of image TYPE, using RELIEF and MARGIN, at point." | 541 | "Insert image FILE of image TYPE, using RELIEF and MARGIN, at point." |
| 541 | |||
| 542 | (let ((i `(image :type ,type | 542 | (let ((i `(image :type ,type |
| 543 | :file ,file | 543 | :file ,file |
| 544 | :relief ,relief | 544 | :relief ,relief |
| @@ -625,8 +625,12 @@ according to the Thumbnail Managing Standard." | |||
| 625 | "For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE." | 625 | "For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE." |
| 626 | (image-dired--check-executable-exists | 626 | (image-dired--check-executable-exists |
| 627 | 'image-dired-cmd-create-thumbnail-program) | 627 | 'image-dired-cmd-create-thumbnail-program) |
| 628 | (let* ((width (int-to-string image-dired-thumb-width)) | 628 | (let* ((width |
| 629 | (height (int-to-string image-dired-thumb-height)) | 629 | (int-to-string (or (and (eq image-dired-thumbnail-storage 'standard) 128) |
| 630 | image-dired-thumb-width))) | ||
| 631 | (height | ||
| 632 | (int-to-string (or (and (eq image-dired-thumbnail-storage 'standard) 128) | ||
| 633 | image-dired-thumb-height))) | ||
| 630 | (modif-time (format "%.0f" (float-time (nth 5 (file-attributes | 634 | (modif-time (format "%.0f" (float-time (nth 5 (file-attributes |
| 631 | original-file))))) | 635 | original-file))))) |
| 632 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" | 636 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" |
| @@ -1615,7 +1619,9 @@ Calculate how many thumbnails fit." | |||
| 1615 | (/ width | 1619 | (/ width |
| 1616 | (+ (* 2 image-dired-thumb-relief) | 1620 | (+ (* 2 image-dired-thumb-relief) |
| 1617 | (* 2 image-dired-thumb-margin) | 1621 | (* 2 image-dired-thumb-margin) |
| 1618 | image-dired-thumb-width char-width)))) | 1622 | (or (and (eq image-dired-thumbnail-storage 'standard) 128) |
| 1623 | image-dired-thumb-width) | ||
| 1624 | char-width)))) | ||
| 1619 | (image-dired-line-up))) | 1625 | (image-dired-line-up))) |
| 1620 | 1626 | ||
| 1621 | (defun image-dired-line-up-interactive () | 1627 | (defun image-dired-line-up-interactive () |