]> git.eshelyaron.com Git - emacs.git/commitdiff
(image-jpeg-p): Accept "Exif" marker.
authorRichard M. Stallman <rms@gnu.org>
Mon, 5 Aug 2002 16:26:03 +0000 (16:26 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 5 Aug 2002 16:26:03 +0000 (16:26 +0000)
lisp/image.el

index b9fcb29cbcd11652ceb63df5ee78ecc0524c4c37..bc6155e9d9cb106934196833f6cd005e66930d0c 100644 (file)
@@ -50,7 +50,8 @@ a non-nil value, TYPE is the image's type ")
 
 
 (defun image-jpeg-p (data)
-  "Value is non-nil if DATA, a string, consists of JFIF image data."
+  "Value is non-nil if DATA, a string, consists of JFIF image data.
+We accept the tag Exif because that is the same format."
   (when (string-match "\\`\xff\xd8" data)
     (catch 'jfif
       (let ((len (length data)) (i 2))
@@ -66,7 +67,7 @@ a non-nil value, TYPE is the image's type ")
            (when (and (>= code #xe0) (<= code #xef))
              ;; APP0 LEN1 LEN2 "JFIF\0"
              (throw 'jfif 
-                    (string-match "JFIF" (substring data i (+ i nbytes)))))
+                    (string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
            (setq i (+ i 1 nbytes))))))))