Variable: image-type-header-regexps
image-type-header-regexps is a variable defined in image.el.gz.
Value
(("\\`/[ \n
]*\\*.*XPM.\\*/" . xpm)
("\\`P[1-6]\\(?:\\(?:\\(?:#[^
\n]*[
\n]\\)*[[:space:]]\\)+\\(?:\\(?:#[^
\n]*[
\n]\\)*[0-9]\\)+\\)\\{2\\}" . pbm)
("\\`GIF8[79]a" . gif)
("\\`\211PNG
\n\n" . png)
("\\`[ \n
]*#define \\([a-z0-9_]+\\)_width [0-9]+\n#define \\1_height [0-9]+\n\\(#define \\1_x_hot [0-9]+\n#define \\1_y_hot [0-9]+\n\\)?static \\(unsigned \\)?char \\1_bits" . xbm)
("\\`\\(?:MM\\*\\|II\\*\\)" . tiff)
("\\`[ \n
]*%!PS" . postscript)
("\\`\377\330" . jpeg)
("\\(?:<\\?xml[
\n]+[^>]*>\\)?[
\n]*<\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->[
\n]*<\\)*\\(?:!DOCTYPE[
\n]+[^>]*>[
\n]*<[
\n]*\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->[
\n]*<\\)*\\)?[Ss][Vv][Gg]" . svg))
Documentation
Alist of (REGEXP . IMAGE-TYPE) pairs used to auto-detect image types.
When the first bytes of an image file match REGEXP, it is assumed to be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol, IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called with one argument, a string containing the image data. If PREDICATE returns a non-nil value, TYPE is the image's type.
Source Code
;; Defined in /usr/src/emacs/lisp/image.el.gz
(defconst image-type-header-regexps
`(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
("\\`P[1-6]\\(?:\
\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\
\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\
\\)\\{2\\}" . pbm)
("\\`GIF8[79]a" . gif)
("\\`\x89PNG\r\n\x1a\n" . png)
("\\`[\t\n\r ]*#define \\([a-z0-9_]+\\)_width [0-9]+\n\
#define \\1_height [0-9]+\n\\(\
#define \\1_x_hot [0-9]+\n\
#define \\1_y_hot [0-9]+\n\\)?\
static \\(unsigned \\)?char \\1_bits" . xbm)
("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . tiff)
("\\`[\t\n\r ]*%!PS" . postscript)
("\\`\xff\xd8" . jpeg) ; used to be (image-jpeg-p . jpeg)
(,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
(comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)")))
(concat "\\(?:<\\?xml[ \t\r\n]+[^>]*>\\)?[ \t\r\n]*<"
comment-re "*"
"\\(?:!DOCTYPE[ \t\r\n]+[^>]*>[ \t\r\n]*<[ \t\r\n]*" comment-re "*\\)?"
"[Ss][Vv][Gg]"))
. svg)
)
"Alist of (REGEXP . IMAGE-TYPE) pairs used to auto-detect image types.
When the first bytes of an image file match REGEXP, it is assumed to
be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol,
IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called
with one argument, a string containing the image data. If PREDICATE returns
a non-nil value, TYPE is the image's type.")