GNU bug report logs -
#54493
27.2; image-convert :data broken
Previous Next
Reported by: awrhygty <at> outlook.com
Date: Mon, 21 Mar 2022 13:23:02 UTC
Severity: normal
Found in version 27.2
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 54493 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Mon, 21 Mar 2022 17:35:07 +0100
> Cc: 54493 <at> debbugs.gnu.org
>
> awrhygty <at> outlook.com writes:
>
> > I tried to view non-native image files.
> > I need not only to set variables, but also to modify a function.
> > The externally converted data is broken by automatic code-conversion.
>
> I can reproduce this in Emacs 27.2, but not on the trunk, so it looks
> like this has been fixed. Here's my test case:
>
> (insert-image
> (create-image
> (with-temp-buffer
> (set-buffer-multibyte nil)
> (insert-file-contents "/home/larsi/src/WebKit/LayoutTests/fast/css/resources/bikes.bmp")
> (buffer-string))
> nil t :format 'image/bmp))
What if you evaluate this first:
(set-default-coding-systems 'utf-8-dos)
Does it still work for you? The OP is on MS-Windows, where the
default decodes the CRFL EOLs, something we shouldn't do with image
data.
In general, I believe explicitly binding coding-system-for-read, as
the OP suggested, is better than relying on some code somewhere that
just happens to let this work (on some systems).
This bug report was last modified 3 years and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.