aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-08-05 16:26:03 +0000
committerRichard M. Stallman2002-08-05 16:26:03 +0000
commit9b78a6a3c463535fdf3961de9f19e65503a8fe28 (patch)
tree7b7e349cd099824d714fbbe2a68d3762aafb03d3
parent241f79af81f44ceccabbf16d3d6c6b4c53963bc4 (diff)
downloademacs-9b78a6a3c463535fdf3961de9f19e65503a8fe28.tar.gz
emacs-9b78a6a3c463535fdf3961de9f19e65503a8fe28.zip
(image-jpeg-p): Accept "Exif" marker.
-rw-r--r--lisp/image.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/image.el b/lisp/image.el
index b9fcb29cbcd..bc6155e9d9c 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -50,7 +50,8 @@ a non-nil value, TYPE is the image's type ")
50 50
51 51
52(defun image-jpeg-p (data) 52(defun image-jpeg-p (data)
53 "Value is non-nil if DATA, a string, consists of JFIF image data." 53 "Value is non-nil if DATA, a string, consists of JFIF image data.
54We accept the tag Exif because that is the same format."
54 (when (string-match "\\`\xff\xd8" data) 55 (when (string-match "\\`\xff\xd8" data)
55 (catch 'jfif 56 (catch 'jfif
56 (let ((len (length data)) (i 2)) 57 (let ((len (length data)) (i 2))
@@ -66,7 +67,7 @@ a non-nil value, TYPE is the image's type ")
66 (when (and (>= code #xe0) (<= code #xef)) 67 (when (and (>= code #xe0) (<= code #xef))
67 ;; APP0 LEN1 LEN2 "JFIF\0" 68 ;; APP0 LEN1 LEN2 "JFIF\0"
68 (throw 'jfif 69 (throw 'jfif
69 (string-match "JFIF" (substring data i (+ i nbytes))))) 70 (string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
70 (setq i (+ i 1 nbytes)))))))) 71 (setq i (+ i 1 nbytes))))))))
71 72
72 73