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

Return non-nil if Emacs can display the specified image FILE.

The returned value is a symbol specifying the image type of FILE, or nil if Emacs cannot display that image type or if the type cannot be determined.

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)
  "Return non-nil if Emacs can display the specified image FILE.
The returned value is a symbol specifying the image type of FILE,
or nil if Emacs cannot display that image type or if the type
cannot be determined."
  (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))))))