Function: image-converter--probe

image-converter--probe is a byte-compiled function defined in image-converter.el.gz.

Signature

(image-converter--probe ARG &rest ARGS)

Implementations

((type (eql 'ffmpeg))) in `image-converter.el'.

Check whether the system has ffmpeg installed.

((type (eql 'imagemagick))) in `image-converter.el'.

Check whether the system has ImageMagick installed.

((type (eql 'graphicsmagick))) in `image-converter.el'.

Check whether the system has GraphicsMagick installed.

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-converter.el.gz
(cl-defmethod image-converter--probe ((type (eql 'graphicsmagick)))
  "Check whether the system has GraphicsMagick installed."
  (with-temp-buffer
    (let ((command (image-converter--value type :command))
          formats)
      (when (and (executable-find (car command))
                 (zerop (apply #'call-process (car command) nil '(t nil) nil
                               (append (cdr command)
                                       (image-converter--value type :probe)))))
        (goto-char (point-min))
        (when (re-search-forward "^-" nil t)
          (forward-line 1)
          ;; Lines look like
          ;; "   8BIM P  rw-  Photoshop resource format".
          (while (re-search-forward "^ *\\([A-Z0-9]+\\) +. +r" nil t)
            (push (downcase (match-string 1)) formats)))
        (nreverse formats)))))