Commit f64ae86c authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(create-image, defimage): Don't assume image data is a

parent 162dec01
......@@ -87,8 +87,8 @@ Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
Optional PROPS are additional image attributes to assign to the image,
like, e.g. `:heuristic-mask t'.
Value is the image created, or nil if images of type TYPE are not supported."
(unless (stringp file-or-data)
(error "Invalid image file name or data `%s'" file-or-data))
(when (and (not data-p) (not (stringp file-or-data)))
(error "Invalid image file name `%s'" file-or-data))
(cond ((null data-p)
;; FILE-OR-DATA is a file name.
(unless (or type
......@@ -206,7 +206,7 @@ Example:
(setq file (expand-file-name file data-directory))
(when (file-readable-p file)
(setq image (cons 'image (plist-put spec :file file)))))
((stringp data)
((not (null data))
(setq image (cons 'image spec)))))
(setq specs (cdr specs))))
`(defvar ,symbol ',image ,doc)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment