comparison lisp/image.el @ 62816:f5a3eeaf3d70

(image-library-alist): Moved to image.c. (image-type-available-p): Doc fix.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 27 May 2005 13:17:50 +0000
parents b0de8a447a79
children 6fb026ad601f 01137c1fdbe9
comparison
equal deleted inserted replaced
62815:94db1d097527 62816:f5a3eeaf3d70
45 When the first bytes of an image file match REGEXP, it is assumed to 45 When the first bytes of an image file match REGEXP, it is assumed to
46 be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol, 46 be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol,
47 IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called 47 IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called
48 with one argument, a string containing the image data. If PREDICATE returns 48 with one argument, a string containing the image data. If PREDICATE returns
49 a non-nil value, TYPE is the image's type.") 49 a non-nil value, TYPE is the image's type.")
50
51 ;;;###autoload
52 (defvar image-library-alist nil
53 "Alist of image types vs external libraries needed to display them.
54
55 Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol
56 representing a supported image type, and the rest are strings giving
57 alternate filenames for the corresponding external libraries.
58
59 Emacs tries to load the libraries in the order they appear on the
60 list; if none is loaded, the running session of Emacs won't
61 support the image type. Types 'pbm and 'xbm don't need to be
62 listed; they're always supported.")
63 ;;;###autoload (put 'image-library-alist 'risky-local-variable t)
64 50
65 (defun image-jpeg-p (data) 51 (defun image-jpeg-p (data)
66 "Value is non-nil if DATA, a string, consists of JFIF image data. 52 "Value is non-nil if DATA, a string, consists of JFIF image data.
67 We accept the tag Exif because that is the same format." 53 We accept the tag Exif because that is the same format."
68 (when (string-match "\\`\xff\xd8" data) 54 (when (string-match "\\`\xff\xd8" data)
120 (image-type-from-data header))) 106 (image-type-from-data header)))
121 107
122 108
123 ;;;###autoload 109 ;;;###autoload
124 (defun image-type-available-p (type) 110 (defun image-type-available-p (type)
125 "Value is non-nil if image type TYPE is available. 111 "Return non-nil if image type TYPE is available.
126 Image types are symbols like `xbm' or `jpeg'." 112 Image types are symbols like `xbm' or `jpeg'."
127 (and (fboundp 'init-image-library) 113 (and (fboundp 'init-image-library)
128 (init-image-library type image-library-alist))) 114 (init-image-library type image-library-alist)))
129 115
130 ;;;###autoload 116 ;;;###autoload