diff options
| author | Gerd Moellmann | 2000-01-01 16:42:20 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-01 16:42:20 +0000 |
| commit | f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247 (patch) | |
| tree | 2a7c150f31cbf66e96709e3889bd8a7bf0b65539 /lisp | |
| parent | 162dec0193a63fdad8ee7d840183360b00b15fa7 (diff) | |
| download | emacs-f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247.tar.gz emacs-f64ae86ca6f65340d25d2f6b4faa2f2f2fd7b247.zip | |
(create-image, defimage): Don't assume image data is a
string.
Diffstat (limited to 'lisp')
| -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. | |||
| 87 | Optional PROPS are additional image attributes to assign to the image, | 87 | Optional PROPS are additional image attributes to assign to the image, |
| 88 | like, e.g. `:heuristic-mask t'. | 88 | like, e.g. `:heuristic-mask t'. |
| 89 | Value is the image created, or nil if images of type TYPE are not supported." | 89 | Value is the image created, or nil if images of type TYPE are not supported." |
| 90 | (unless (stringp file-or-data) | 90 | (when (and (not data-p) (not (stringp file-or-data))) |
| 91 | (error "Invalid image file name or data `%s'" file-or-data)) | 91 | (error "Invalid image file name `%s'" file-or-data)) |
| 92 | (cond ((null data-p) | 92 | (cond ((null data-p) |
| 93 | ;; FILE-OR-DATA is a file name. | 93 | ;; FILE-OR-DATA is a file name. |
| 94 | (unless (or type | 94 | (unless (or type |
| @@ -206,7 +206,7 @@ Example: | |||
| 206 | (setq file (expand-file-name file data-directory)) | 206 | (setq file (expand-file-name file data-directory)) |
| 207 | (when (file-readable-p file) | 207 | (when (file-readable-p file) |
| 208 | (setq image (cons 'image (plist-put spec :file file))))) | 208 | (setq image (cons 'image (plist-put spec :file file))))) |
| 209 | ((stringp data) | 209 | ((not (null data)) |
| 210 | (setq image (cons 'image spec))))) | 210 | (setq image (cons 'image spec))))) |
| 211 | (setq specs (cdr specs)))) | 211 | (setq specs (cdr specs)))) |
| 212 | `(defvar ,symbol ',image ,doc))) | 212 | `(defvar ,symbol ',image ,doc))) |