# HG changeset patch # User Gerd Moellmann # Date 946744940 0 # Node ID 893ec72bd6b1121f960d83e8dbff33daa0415fce # Parent 3ddce8cdf6156aebdf56b04ecc8215c83139f4f2 (create-image, defimage): Don't assume image data is a string. diff -r 3ddce8cdf615 -r 893ec72bd6b1 lisp/image.el --- a/lisp/image.el Sat Jan 01 16:33:32 2000 +0000 +++ b/lisp/image.el Sat Jan 01 16:42:20 2000 +0000 @@ -87,8 +87,8 @@ 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 @@ (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)))