summaryrefslogtreecommitdiff
path: root/lisp/image-dired.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-12-19 20:35:02 -0500
committerMark Oteiza <mvoteiza@udel.edu>2016-12-19 20:35:02 -0500
commit5c266405f559823038dfa900aaad66605f0d5287 (patch)
treeb8426baa0faf65a946487e83dc3d4d288e86e1d0 /lisp/image-dired.el
parent36b9973dec65c8daf57d1cb73f0de5a3c59279fc (diff)
downloademacs-5c266405f559823038dfa900aaad66605f0d5287.tar.gz
Recognize graphicsmagick in image-dired
* lisp/image-dired.el (image-dired-cmd-create-thumbnail-program): (image-dired-cmd-create-thumbnail-options): (image-dired-cmd-create-temp-image-program): (image-dired-cmd-create-temp-image-options): (image-dired-cmd-create-standard-thumbnail-options): (image-dired-cmd-rotate-thumbnail-program): (image-dired-cmd-rotate-thumbnail-options): Account for existence of gm(1) executable.
Diffstat (limited to 'lisp/image-dired.el')
-rw-r--r--lisp/image-dired.el48
1 files changed, 33 insertions, 15 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 560cadbe75b..eed4280c034 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -221,14 +221,19 @@ expects to find pictures in this directory."
:group 'image-dired)
(defcustom image-dired-cmd-create-thumbnail-program
- "convert"
+ (cond ((executable-find "gm") "gm")
+ ((executable-find "convert") "convert")
+ (t "convert"))
"Executable used to create thumbnail.
Used together with `image-dired-cmd-create-thumbnail-options'."
+ :version "26.1"
:type 'file
:group 'image-dired)
(defcustom image-dired-cmd-create-thumbnail-options
- '("-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t")
+ `(,@(when (string-match "gm\\'" image-dired-cmd-create-thumbnail-program)
+ '("convert"))
+ "-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t")
"Options of command used to create thumbnail image.
Used with `image-dired-cmd-create-thumbnail-program'.
Available format specifiers are: %w which is replaced by
@@ -239,14 +244,20 @@ which is replaced by the file name of the thumbnail file."
:type '(repeat (string :tag "Argument"))
:group 'image-dired)
-(defcustom image-dired-cmd-create-temp-image-program "convert"
+(defcustom image-dired-cmd-create-temp-image-program
+ (cond ((executable-find "gm") "gm")
+ ((executable-find "convert") "convert")
+ (t "convert"))
"Executable used to create temporary image.
Used together with `image-dired-cmd-create-temp-image-options'."
+ :version "26.1"
:type 'file
:group 'image-dired)
(defcustom image-dired-cmd-create-temp-image-options
- '("-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t")
+ `(,@(when (string-match "gm\\'" image-dired-cmd-create-temp-image-program)
+ '("convert"))
+ "-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t")
"Options of command used to create temporary image for display window.
Used together with `image-dired-cmd-create-temp-image-program',
Available format specifiers are: %w and %h which are replaced by
@@ -316,15 +327,17 @@ Available format specifiers are described in
:group 'image-dired)
(defcustom image-dired-cmd-create-standard-thumbnail-options
- (append '("-size" "%wx%h" "%f")
- (unless (or image-dired-cmd-pngcrush-program
- image-dired-cmd-pngnq-program)
- (list
- "-set" "Thumb::MTime" "%m"
- "-set" "Thumb::URI" "file://%f"
- "-set" "Description" "Thumbnail of file://%f"
- "-set" "Software" (emacs-version)))
- '("-thumbnail" "%wx%h>" "png:%t"))
+ `(,@(when (string-match "gm\\'" image-dired-cmd-create-thumbnail-program)
+ '("convert"))
+ "-size" "%wx%h" "%f"
+ ,@(unless (or image-dired-cmd-pngcrush-program
+ image-dired-cmd-pngnq-program)
+ (list
+ "-set" "Thumb::MTime" "%m"
+ "-set" "Thumb::URI" "file://%f"
+ "-set" "Description" "Thumbnail of file://%f"
+ "-set" "Software" (emacs-version)))
+ "-thumbnail" "%wx%h>" "png:%t")
"Options for creating thumbnails according to the Thumbnail Managing Standard.
Available format specifiers are the same as in
`image-dired-cmd-create-thumbnail-options', with %m for file modification time."
@@ -333,14 +346,19 @@ Available format specifiers are the same as in
:group 'image-dired)
(defcustom image-dired-cmd-rotate-thumbnail-program
- "mogrify"
+ (cond ((executable-find "gm") "gm")
+ ((executable-find "mogrify") "mogrify")
+ (t "mogrify"))
"Executable used to rotate thumbnail.
Used together with `image-dired-cmd-rotate-thumbnail-options'."
+ :version "26.1"
:type 'file
:group 'image-dired)
(defcustom image-dired-cmd-rotate-thumbnail-options
- '("-rotate" "%d" "%t")
+ `(,@(when (string-match "gm\\'" image-dired-cmd-rotate-thumbnail-program)
+ '("mogrify"))
+ "-rotate" "%d" "%t")
"Arguments of command used to rotate thumbnail image.
Used with `image-dired-cmd-rotate-thumbnail-program'.
Available format specifiers are: %d which is replaced by the