]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix detection of WebP images by their signature
authorVisuwesh <visuweshm@gmail.com>
Wed, 12 Apr 2023 13:47:23 +0000 (19:17 +0530)
committerEli Zaretskii <eliz@gnu.org>
Wed, 12 Apr 2023 17:04:26 +0000 (20:04 +0300)
* lisp/image.el (image-type-header-regexps): The 4 characters
between "RIFF" and "WEBP" in WebP images can also be newlines.
(Bug#62790)

lisp/image.el

index 6a8293fedf311452501d2357f4f10ec147c91782..104fea407ffb1c69d598d210ae736eadbaac86fc 100644 (file)
@@ -51,7 +51,7 @@ static \\(unsigned \\)?char \\1_bits" . xbm)
     ("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . tiff)
     ("\\`[\t\n\r ]*%!PS" . postscript)
     ("\\`\xff\xd8" . jpeg)    ; used to be (image-jpeg-p . jpeg)
-    ("\\`RIFF....WEBPVP8" . webp)
+    ("\\`RIFF[^z-a][^z-a][^z-a][^z-a]WEBPVP8" . webp)
     (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
             (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)")))
        (concat "\\(?:<\\?xml[ \t\r\n]+[^>]*>\\)?[ \t\r\n]*<"