changeset 38746:0fc8e4a27edc

(image-type-regexps): Allow whitespace at the start of the image data for XPM, XBM and Postscript, which are text files. (image-jpeg-p): Correct computatino of next field offset.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 09 Aug 2001 09:31:56 +0000
parents 5464ee1ba8e2
children 258f3e803e75
files lisp/image.el
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/image.el	Wed Aug 08 23:39:08 2001 +0000
+++ b/lisp/image.el	Thu Aug 09 09:31:56 2001 +0000
@@ -31,13 +31,13 @@
 
 
 (defconst image-type-regexps
-  '(("\\`/\\*.*XPM.\\*/" . xpm)
+  '(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
     ("\\`P[1-6]" . pbm)
     ("\\`GIF8" . gif)
     ("\\`\211PNG\r\n" . png)
-    ("\\`#define" . xbm)
+    ("\\`[\t\n\r ]*#define" . xbm)
     ("\\`\\(MM\0\\*\\)\\|\\(II\\*\0\\)" . tiff)
-    ("\\`%!PS" . postscript)
+    ("\\`[\t\n\r ]*%!PS" . postscript)
     ("\\`\xff\xd8" . (image-jpeg-p . jpeg)))
   "Alist of (REGEXP . IMAGE-TYPE) pairs used to auto-detect image types.
 When the first bytes of an image file match REGEXP, it is assumed to
@@ -64,7 +64,7 @@
 	      ;; APP0 LEN1 LEN2 "JFIF\0"
 	      (throw 'jfif (string-match "\\`\xe0..JFIF\0" 
 					 (substring data i (+ i 10)))))
-	    (setq i (+ i nbytes))))))))
+	    (setq i (+ i 1 nbytes))))))))
 
 
 ;;;###autoload