GNU bug report logs - #62790
29.0.60; WEBP header regexp in image-type-header-regexps fails files containing newlines

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Wed, 12 Apr 2023 13:48:02 UTC

Severity: normal

Merged with 62789

Found in version 29.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 62790 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62790 <at> debbugs.gnu.org
Subject: Re: bug#62790: 29.0.60; WEBP header regexp in
 image-type-header-regexps fails files containing newlines
Date: Wed, 12 Apr 2023 22:22:29 +0530
[புதன் ஏப்ரல் 12, 2023] Eli Zaretskii wrote:

> merge 62790 62789
> thanks
>
>> From: Visuwesh <visuweshm <at> gmail.com>
>> Date: Wed, 12 Apr 2023 19:17:23 +0530
>> 
>> Attached image contains a newline in the header after "RIFF" which the
>> regexp in image-type-header-regexps fails to match.  This makes
>> create-image return nil for such an image when FILE-OR-DATA is DATA and
>> DATA-P is non-nil.
>
> Not sure why you filed two identical reports.  Did you send the same
> email twice to the bug tracker?

It was an accident.  I was having power cuts every 15 mins, it got me
and I managed to send the mail twice.

[புதன் ஏப்ரல் 12, 2023] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Date: Wed, 12 Apr 2023 19:17:13 +0530
>> 
>> Attached image contains a newline in the header after "RIFF" which the
>> regexp in image-type-header-regexps fails to match.  This makes
>> create-image return nil for such an image when FILE-OR-DATA is DATA and
>> DATA-P is non-nil.
>
> Thanks, but please show a recipe, starting from "emacs -Q", to
> reproduce the problem with this image.  I just visited it with
> "C-x C-f" and didn't see any problems.

Please evaluate

    (create-image
        (with-temp-buffer
            (insert-file-contents-literally "/path/to/attached/image")
            (buffer-string))
        nil t)

in emacs -Q and observe the return value.  It will return nil even
though it is a valid webp file.  The reason C-x C-f succeeds is because
the file has the "webp" extension and thusly `image-supported-p' call in
`image-type' returns non-nil.




This bug report was last modified 2 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.