Function: image-dired--probe-thumbnail-cmd

image-dired--probe-thumbnail-cmd is a byte-compiled function defined in image-dired-external.el.gz.

Signature

(image-dired--probe-thumbnail-cmd CMD)

Documentation

Check whether CMD is usable for thumbnail creation.

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-dired-external.el.gz
(defun image-dired--probe-thumbnail-cmd (cmd)
  "Check whether CMD is usable for thumbnail creation."
  (cond
   ;; MS-Windows has an incompatible 'convert' command.  Make sure this
   ;; is the one we expect, from ImageMagick.  FIXME: Should we do this
   ;; also on systems other than MS-Windows?
   ((and (memq system-type '(windows-nt cygwin ms-dos))
         (member (downcase (file-name-nondirectory cmd))
                 '("convert" "convert.exe")))
    (with-temp-buffer
      (let (process-file-side-effects)
        (and (equal (condition-case nil
                        ;; Implementation note: 'process-file' below
                        ;; returns non-zero status when convert.exe is
                        ;; the Windows command, because we quote the
                        ;; "/?" argument, and Windows is not smart
                        ;; enough to process quoted options correctly.
                        (apply #'process-file cmd nil t nil '("/?"))
		      (error nil))
		    0)
	     (progn
	       (goto-char (point-min))
	       (looking-at-p "Version: ImageMagick"))))))
   (t t)))