From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54493: 27.2; image-convert :data broken Date: Mon, 21 Mar 2022 18:59:48 +0200 Message-ID: <83h77rfdh7.fsf@gnu.org> References: <8735jbtgas.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16019"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54493@debbugs.gnu.org, awrhygty@outlook.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 21 18:01:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWLP5-0003t3-OG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 18:01:11 +0100 Original-Received: from localhost ([::1]:46636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWLP4-0000s3-Oa for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 13:01:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWLOw-0000qM-Iv for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 13:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWLOw-0003v8-9a for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 13:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWLOw-0001vu-7V for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 13:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54493 X-GNU-PR-Package: emacs Original-Received: via spool by 54493-submit@debbugs.gnu.org id=B54493.16478820426060 (code B ref 54493); Mon, 21 Mar 2022 17:01:02 +0000 Original-Received: (at 54493) by debbugs.gnu.org; 21 Mar 2022 17:00:42 +0000 Original-Received: from localhost ([127.0.0.1]:38003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWLOb-0001ZF-FI for submit@debbugs.gnu.org; Mon, 21 Mar 2022 13:00:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWLOZ-0001Rs-Id for 54493@debbugs.gnu.org; Mon, 21 Mar 2022 13:00:39 -0400 Original-Received: from [2001:470:142:3::e] (port=46158 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWLOT-0003sZ-E7; Mon, 21 Mar 2022 13:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CZl21nWD2M/u8NhLICsxenr4l7YvYKXkewqn0uhi2IM=; b=DQtlVQzDKfDJ 26Bt8ABuwKmAY6HRScpN7ipo6YR38k4oCrNYcuBPE8Y6GOMBEmh+fnUMBS3Kej+2o4qaSmqRIznUD tUZ2P/nFwv+XDFTb+x9T9l1Q4FCEajtkxZF2Po4wluRVCnsawTjhvNrRVkuSbdBnPa3xXa9hsaBSG JWLJOdkFtbt2soxUQzBXm4YC333ApmwWN5DTcOrgZ+gnagVCmPdfdvq0dyHQs0vu7gfX/Dr4lQXVj BD84P7KbkBJIoqCJ2zwhEuBMi1o6WIkPMSBnI1yj1cTUOdBOBaDaGpUt/q0ZpvXz7Fdav3BVykGwY yyHL9AsNTFSp5s85tP9MFw==; Original-Received: from [87.69.77.57] (port=3178 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWLNz-0005aG-Qi; Mon, 21 Mar 2022 13:00:25 -0400 In-Reply-To: <8735jbtgas.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 21 Mar 2022 17:35:07 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228694 Archived-At: > From: Lars Ingebrigtsen > Date: Mon, 21 Mar 2022 17:35:07 +0100 > Cc: 54493@debbugs.gnu.org > > awrhygty@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).