[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/image.el,v [EMACS_22_BASE]
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/image.el,v [EMACS_22_BASE] |
Date: |
Mon, 14 Jan 2008 13:19:28 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Jason Rumney <jasonr> 08/01/14 13:19:28
Index: image.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image.el,v
retrieving revision 1.70.2.4
retrieving revision 1.70.2.5
diff -u -b -r1.70.2.4 -r1.70.2.5
--- image.el 7 Jan 2008 02:44:40 -0000 1.70.2.4
+++ image.el 14 Jan 2008 13:19:28 -0000 1.70.2.5
@@ -313,21 +313,13 @@
Optional DATA-P non-nil means FILE-OR-DATA is a string containing image 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
- (setq type (image-type-from-file-header file-or-data)))
- (let ((extension (file-name-extension file-or-data)))
- (unless extension
- (error "Cannot determine image type"))
- (setq type (intern extension)))))
- (t
- ;; FILE-OR-DATA contains image data.
(unless type
- (setq type (image-type-from-data file-or-data)))))
- (unless type
- (error "Cannot determine image type"))
- (unless (symbolp type)
+ (setq type (if data-p
+ (image-type-from-data file-or-data)
+ (or (image-type-from-file-header file-or-data)
+ (image-type-from-file-name file-or-data))))
+ (or type(error "Cannot determine image type")))
+ (or (memq type (and (boundp 'image-types) image-types))
(error "Invalid image type `%s'" type))
type)