Function: image-supported-file-p

image-supported-file-p is a byte-compiled function defined in image.el.gz.

Signature

(image-supported-file-p FILE)

Documentation

Say whether Emacs has native support for displaying TYPE.

The value is a symbol specifying the image type, or nil if type cannot be determined (or if Emacs doesn't have built-in support for the image type).

Aliases

thumbs-image-type (obsolete since 29.1)

Source Code

;; Defined in /usr/src/emacs/lisp/image.el.gz
 ;;;###autoload
(defun image-supported-file-p (file)
  "Say whether Emacs has native support for displaying TYPE.
The value is a symbol specifying the image type, or nil if type
cannot be determined (or if Emacs doesn't have built-in support
for the image type)."
  (let ((case-fold-search t)
        type)
    (catch 'found
      (dolist (elem image-type-file-name-regexps)
	(when (and (string-match-p (car elem) file)
                   (image-type-available-p (setq type (cdr elem))))
	  (throw 'found type))))))