diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-01-01 16:42:20 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-01-01 16:42:20 +0000 |
commit | f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247 (patch) | |
tree | 2a7c150f31cbf66e96709e3889bd8a7bf0b65539 /lisp/image.el | |
parent | 162dec0193a63fdad8ee7d840183360b00b15fa7 (diff) | |
download | emacs-f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247.tar.gz |
(create-image, defimage): Don't assume image data is a
string.
Diffstat (limited to 'lisp/image.el')
-rw-r--r-- | lisp/image.el | 6 |
1 files 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))) |