Function: shr-image-from-data

shr-image-from-data is a byte-compiled function defined in shr.el.gz.

Signature

(shr-image-from-data DATA)

Documentation

Return an image from the data: URI content DATA.

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-image-from-data (data)
  "Return an image from the data: URI content DATA."
  (when (string-match
	 "\\(\\([^/;,]+\\(/[^;,]+\\)?\\)\\(;[^;,]+\\)*\\)?,\\(.*\\)"
	 data)
    (let ((param (match-string 4 data))
	  (payload (url-unhex-string (match-string 5 data))))
      (when (and param
                 (string-match "^.*\\(;[ \t]*base64\\)$" param))
	(setq payload (ignore-errors
                        (base64-decode-string payload))))
      payload)))