From f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sat, 1 Jan 2000 16:42:20 +0000 Subject: [PATCH] (create-image, defimage): Don't assume image data is a string. --- lisp/image.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/image.el b/lisp/image.el index 81ca8cfc4a9..daee7994b27 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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)))