be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol,
IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called
with one argument, a string containing the image data. If PREDICATE returns
-a non-nil value, TYPE is the image's type ")
+a non-nil value, TYPE is the image's type.")
(defun image-jpeg-p (data)
(code (aref data i)))
(when (and (>= code #xe0) (<= code #xef))
;; APP0 LEN1 LEN2 "JFIF\0"
- (throw 'jfif
- (string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
+ (throw 'jfif
+ (string-match "JFIF\\|Exif"
+ (substring data i (min (+ i nbytes) len)))))
(setq i (+ i 1 nbytes))))))))
(provide 'image)
+;;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3
;;; image.el ends here