From: Richard M. Stallman Date: Mon, 5 Aug 2002 16:26:03 +0000 (+0000) Subject: (image-jpeg-p): Accept "Exif" marker. X-Git-Tag: ttn-vms-21-2-B4~13760 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b78a6a3c463535fdf3961de9f19e65503a8fe28;p=emacs.git (image-jpeg-p): Accept "Exif" marker. --- 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 ") (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))))))))