diff --git a/lisp/image.el b/lisp/image.el index 7e42c26dd69b848556a3389a2c26532f74bd6979..99632b84307934ba08f5b5bbe3f56d07570e9e4d 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -323,7 +323,7 @@ Optional DATA-P non-nil means SOURCE is a string containing image data." (or (image-type-from-file-header source) (image-type-from-file-name source)))) (or type (error "Cannot determine image type"))) - (or (memq type image-types) + (or (memq type (and (boundp 'image-types) image-types)) (error "Invalid image type `%s'" type)) type)