From unknown Sun Aug 17 09:09:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#28824 <28824@debbugs.gnu.org> To: bug#28824 <28824@debbugs.gnu.org> Subject: Status: 26.0.90; display of pbm images broken? Reply-To: bug#28824 <28824@debbugs.gnu.org> Date: Sun, 17 Aug 2025 16:09:30 +0000 retitle 28824 26.0.90; display of pbm images broken? reassign 28824 emacs submitter 28824 "Roland Winkler" severity 28824 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 22:11:20 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 02:11:20 +0000 Received: from localhost ([127.0.0.1]:38614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Bv5-0006Bx-RZ for submit@debbugs.gnu.org; Fri, 13 Oct 2017 22:11:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Bv4-0006Bk-PU for submit@debbugs.gnu.org; Fri, 13 Oct 2017 22:11:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Buy-0001w7-PZ for submit@debbugs.gnu.org; Fri, 13 Oct 2017 22:11:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3Buy-0001w1-M6 for submit@debbugs.gnu.org; Fri, 13 Oct 2017 22:11:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Bux-0005nD-LB for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 22:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Buw-0001vW-Is for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 22:11:11 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Buw-0001vS-F5 for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 22:11:10 -0400 Received: from [2602:30a:2e52:d720:65b7:1416:12e7:8bfb] (port=59950 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1e3Buw-0001ND-20 for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 22:11:10 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <29226.45866.855134.23009@gargle.gargle.HOWL> Date: Fri, 13 Oct 2017 21:10:50 -0500 From: "Roland Winkler" To: bug-gnu-emacs@gnu.org Subject: 26.0.90; display of pbm images broken? X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) start emacs -Q evaluate (arg FILE-OR-DATA of create-image should point to a pbm image) (defun foo () (interactive) (insert-image (create-image "~/foo.pbm"))) M-x foo This displays the image with emacs 25, but not with emacs 26.0.90: there is just a small bounding box (smaller than the image) where the image should be displayed. It is my understanding that pbm images do not depend on external libraries. (Anyway, I built emacs 25 on the same machine without problems.) In GNU Emacs 26.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-10-13 built on regnitz Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.04.3 LTS Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LCMS2 Important settings: value of $LC_COLLATE: C value of $LANG: en_US.utf8 value of $XMODIFIERS: locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: display-time-mode: t tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 03:02:11 2017 Received: (at 28824) by debbugs.gnu.org; 14 Oct 2017 07:02:11 +0000 Received: from localhost ([127.0.0.1]:38713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3GSZ-0000a0-6u for submit@debbugs.gnu.org; Sat, 14 Oct 2017 03:02:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3GSX-0000Zo-5G for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 03:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3GSO-0006NN-0D for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 03:02:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3GSN-0006NI-U2 for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 03:01:59 -0400 Received: from [176.228.60.248] (port=3159 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3GSM-0004p3-Gu; Sat, 14 Oct 2017 03:01:59 -0400 Date: Sat, 14 Oct 2017 10:01:52 +0300 Message-Id: <83376mjjq7.fsf@gnu.org> From: Eli Zaretskii To: "Roland Winkler" In-reply-to: <29226.45866.855134.23009@gargle.gargle.HOWL> (winkler@gnu.org) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Fri, 13 Oct 2017 21:10:50 -0500 > From: "Roland Winkler" > > start emacs -Q > evaluate (arg FILE-OR-DATA of create-image should point to a pbm image) > > (defun foo () > (interactive) > (insert-image (create-image "~/foo.pbm"))) > > M-x foo > > This displays the image with emacs 25, but not with emacs 26.0.90: Works for me in Emacs 26.0.90 on MS-Windows. I used PBM images from etc/images/ in the Emacs tree: does this fail to work for you with those images as well? > It is my understanding that pbm images do not depend on external > libraries. Yes, no external libraries should be needed. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 11:01:58 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 15:01:58 +0000 Received: from localhost ([127.0.0.1]:40368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Nwr-0007wD-Qd for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:01:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Nwp-0007vm-Sd for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Nwj-0004vX-L4 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:01:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3Nwj-0004vL-Hx for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:01:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Nwi-0004Zs-F7 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 11:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Nwf-0004tC-7B for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 11:01:48 -0400 Received: from [195.159.176.226] (port=53727 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3Nwf-0004sh-0H for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 11:01:45 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3NwO-0007S3-Rn for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 17:01:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sat, 14 Oct 2017 16:01:20 +0100 Lines: 31 Message-ID: <86po9p93jz.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) Cancel-Lock: sha1:LUnczSSDXmhBkLniZM4drjwlBEA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Eli Zaretskii wrote: >> Date: Fri, 13 Oct 2017 21:10:50 -0500 >> From: "Roland Winkler" >> >> start emacs -Q >> evaluate (arg FILE-OR-DATA of create-image should point to a pbm image) >> >> (defun foo () >> (interactive) >> (insert-image (create-image "~/foo.pbm"))) >> >> M-x foo >> >> This displays the image with emacs 25, but not with emacs 26.0.90: > > Works for me in Emacs 26.0.90 on MS-Windows. I used PBM images from > etc/images/ in the Emacs tree: does this fail to work for you with > those images as well? > >> It is my understanding that pbm images do not depend on external >> libraries. > > Yes, no external libraries should be needed. I see problems with some PBM files from etc/images with emacs 26.0.90 on Windows. The ones that don't work appear to be those that contain a Netpbm header, e.g. back-arrow.pbm close.pbm cut.pbm fwd-arrow.pbm home.pbm AndyM From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 11:31:18 2017 Received: (at 28824) by debbugs.gnu.org; 14 Oct 2017 15:31:18 +0000 Received: from localhost ([127.0.0.1]:40390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3OPF-0000H3-T2 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:31:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3OPE-0000Gp-GU for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 11:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3OP6-0003n2-13 for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 11:31:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3OP5-0003my-U6; Sat, 14 Oct 2017 11:31:07 -0400 Received: from [176.228.60.248] (port=3889 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3OP5-000259-7l; Sat, 14 Oct 2017 11:31:07 -0400 Date: Sat, 14 Oct 2017 18:31:02 +0300 Message-Id: <83d15piw5l.fsf@gnu.org> From: Eli Zaretskii To: Andy Moreton In-reply-to: <86po9p93jz.fsf@gmail.com> (message from Andy Moreton on Sat, 14 Oct 2017 16:01:20 +0100) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Andy Moreton > Date: Sat, 14 Oct 2017 16:01:20 +0100 > > I see problems with some PBM files from etc/images with emacs 26.0.90 on > Windows. The ones that don't work appear to be those that contain a > Netpbm header, e.g. back-arrow.pbm close.pbm cut.pbm fwd-arrow.pbm > home.pbm I see no problems with those images you mention as problematic. Could it be a problem specific to 64-bit builds? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 14:16:50 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 18:16:50 +0000 Received: from localhost ([127.0.0.1]:40503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3QzS-0008Hy-Er for submit@debbugs.gnu.org; Sat, 14 Oct 2017 14:16:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3QzR-0008Hf-2Y for submit@debbugs.gnu.org; Sat, 14 Oct 2017 14:16:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3QzL-0005Zl-1y for submit@debbugs.gnu.org; Sat, 14 Oct 2017 14:16:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3QzK-0005Zd-Vb for submit@debbugs.gnu.org; Sat, 14 Oct 2017 14:16:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3QzJ-0006nj-T7 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 14:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3QzG-0005YO-Na for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 14:16:41 -0400 Received: from [195.159.176.226] (port=47393 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3QzG-0005Y1-Gy for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 14:16:38 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3Qys-0007QD-RQ for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 20:16:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sat, 14 Oct 2017 19:16:11 +0100 Lines: 20 Message-ID: <86lgkd8uj8.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) Cancel-Lock: sha1:VMFX3D6XWjpGFc7h4TPEb7a4D9E= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Sat, 14 Oct 2017 16:01:20 +0100 >> >> I see problems with some PBM files from etc/images with emacs 26.0.90 on >> Windows. The ones that don't work appear to be those that contain a >> Netpbm header, e.g. back-arrow.pbm close.pbm cut.pbm fwd-arrow.pbm >> home.pbm > > I see no problems with those images you mention as problematic. > > Could it be a problem specific to 64-bit builds? I've tried this in a 32bit MinGW build with the same results. It appears to be a problem with the pbm entry in image-type-header-regexps, as doing (setq image-type-header-regexps '(("\\`P[1-6]" . pbm))) results in the problematic images displaying correctly. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 15:04:06 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 19:04:06 +0000 Received: from localhost ([127.0.0.1]:40523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3RjB-00010k-U7 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:04:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3RjA-00010H-Lp for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:04:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Rj4-0006pO-Lh for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:03:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3Rj4-0006pK-J1 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:03:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Rj3-0007kG-FQ for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:03:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Rj0-0006nl-CC for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:03:57 -0400 Received: from [195.159.176.226] (port=58343 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3Rj0-0006nL-4c for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:03:54 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3Ric-0003zn-JW for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 21:03:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sat, 14 Oct 2017 20:03:27 +0100 Lines: 43 Message-ID: <86h8v18scg.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> <86lgkd8uj8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) Cancel-Lock: sha1:9530hcVOkxKtuW6ktr03M3wCMKQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Andy Moreton wrote: > On Sat 14 Oct 2017, Eli Zaretskii wrote: > >>> From: Andy Moreton >>> Date: Sat, 14 Oct 2017 16:01:20 +0100 >>> >>> I see problems with some PBM files from etc/images with emacs 26.0.90 on >>> Windows. The ones that don't work appear to be those that contain a >>> Netpbm header, e.g. back-arrow.pbm close.pbm cut.pbm fwd-arrow.pbm >>> home.pbm >> >> I see no problems with those images you mention as problematic. >> >> Could it be a problem specific to 64-bit builds? > > I've tried this in a 32bit MinGW build with the same results. It appears > to be a problem with the pbm entry in image-type-header-regexps, as > doing (setq image-type-header-regexps '(("\\`P[1-6]" . pbm))) results in > the problematic images displaying correctly. > > AndyM The file format is described at http://netpbm.sourceforge.net/doc/pbm.html Further testing with the images from etc/images in emacs 26 shows that this patch appears to fix the problem: diff --git a/lisp/image.el b/lisp/image.el index 1d0776180b..32df508bc8 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -34,8 +34,8 @@ 'image-refresh (defconst image-type-header-regexps `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]\\(?:\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ \\)\\{2\\}" . pbm) ("\\`GIF8[79]a" . gif) ("\\`\x89PNG\r\n\x1a\n" . png) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 15:14:33 2017 Received: (at 28824) by debbugs.gnu.org; 14 Oct 2017 19:14:33 +0000 Received: from localhost ([127.0.0.1]:40533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3RtJ-0001H0-0W for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:14:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3RtH-0001Go-Fk for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 15:14:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Rt9-0003Lc-8M for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 15:14:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Rt9-0003LS-4p; Sat, 14 Oct 2017 15:14:23 -0400 Received: from [176.228.60.248] (port=4024 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3Rt7-00009g-7I; Sat, 14 Oct 2017 15:14:22 -0400 Date: Sat, 14 Oct 2017 22:14:07 +0300 Message-Id: <834lr1ilts.fsf@gnu.org> From: Eli Zaretskii To: Andy Moreton In-reply-to: <86lgkd8uj8.fsf@gmail.com> (message from Andy Moreton on Sat, 14 Oct 2017 19:16:11 +0100) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> <86lgkd8uj8.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Andy Moreton > Date: Sat, 14 Oct 2017 19:16:11 +0100 > > > I see no problems with those images you mention as problematic. > > > > Could it be a problem specific to 64-bit builds? > > I've tried this in a 32bit MinGW build with the same results. It appears > to be a problem with the pbm entry in image-type-header-regexps, as > doing (setq image-type-header-regexps '(("\\`P[1-6]" . pbm))) results in > the problematic images displaying correctly. Then why does it work here with the unmodified PBM entry? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 15:17:05 2017 Received: (at 28824) by debbugs.gnu.org; 14 Oct 2017 19:17:05 +0000 Received: from localhost ([127.0.0.1]:40537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Rvj-0001La-Ck for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:17:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Rvi-0001L4-6s for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 15:17:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Rva-0004Wh-1P for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 15:16:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3RvZ-0004Wc-UC; Sat, 14 Oct 2017 15:16:53 -0400 Received: from [176.228.60.248] (port=4026 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3RvY-0000Vp-0o; Sat, 14 Oct 2017 15:16:53 -0400 Date: Sat, 14 Oct 2017 22:16:37 +0300 Message-Id: <83376lilpm.fsf@gnu.org> From: Eli Zaretskii To: Andy Moreton In-reply-to: <86h8v18scg.fsf@gmail.com> (message from Andy Moreton on Sat, 14 Oct 2017 20:03:27 +0100) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> <86lgkd8uj8.fsf@gmail.com> <86h8v18scg.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Andy Moreton > Date: Sat, 14 Oct 2017 20:03:27 +0100 > > Further testing with the images from etc/images in emacs 26 shows that > this patch appears to fix the problem: > > diff --git a/lisp/image.el b/lisp/image.el > index 1d0776180b..32df508bc8 100644 > --- a/lisp/image.el > +++ b/lisp/image.el > @@ -34,8 +34,8 @@ 'image-refresh > (defconst image-type-header-regexps > `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) > ("\\`P[1-6]\\(?:\ > -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ > -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ > +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ > +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ > \\)\\{2\\}" . pbm) > ("\\`GIF8[79]a" . gif) > ("\\`\x89PNG\r\n\x1a\n" . png) Thanks. However, I'm puzzled by the fact that it works here without any changes. Can you step with a debugger through the code in image.c and tell what exactly fails with the unmodified regexp? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 15:51:07 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 19:51:08 +0000 Received: from localhost ([127.0.0.1]:40543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3SSh-0002B5-NW for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:51:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3SSg-0002Ab-Iu for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3SSa-0005iR-DY for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:51:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3SSa-0005iK-9m for submit@debbugs.gnu.org; Sat, 14 Oct 2017 15:51:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3SSZ-0005YS-5U for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3SSV-0005ft-8l for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:50:59 -0400 Received: from [195.159.176.226] (port=39925 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3SSV-0005fP-1n for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 15:50:55 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3SSH-0003AW-AE for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 21:50:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sat, 14 Oct 2017 20:50:28 +0100 Lines: 38 Message-ID: <86vajh4igr.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> <86lgkd8uj8.fsf@gmail.com> <86h8v18scg.fsf@gmail.com> <83376lilpm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) Cancel-Lock: sha1:6/k+veJjlGj5hJHnWLwAdU2shZU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Sat, 14 Oct 2017 20:03:27 +0100 >> >> Further testing with the images from etc/images in emacs 26 shows that >> this patch appears to fix the problem: >> >> diff --git a/lisp/image.el b/lisp/image.el >> index 1d0776180b..32df508bc8 100644 >> --- a/lisp/image.el >> +++ b/lisp/image.el >> @@ -34,8 +34,8 @@ 'image-refresh >> (defconst image-type-header-regexps >> `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) >> ("\\`P[1-6]\\(?:\ >> -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ >> -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ >> +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ >> +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ >> \\)\\{2\\}" . pbm) >> ("\\`GIF8[79]a" . gif) >> ("\\`\x89PNG\r\n\x1a\n" . png) > > Thanks. However, I'm puzzled by the fact that it works here without > any changes. Loading the troublesome images from "emacs -Q" also works in unmodified emacs 26, so something in my init.el changes the behaviour. > Can you step with a debugger through the code in image.c and tell what > exactly fails with the unmodified regexp? The problem is in image.el, where string-match-p in image-type-from-data fails to match the regexp. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 16:16:19 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 20:16:19 +0000 Received: from localhost ([127.0.0.1]:40552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Sr4-0002nH-QU for submit@debbugs.gnu.org; Sat, 14 Oct 2017 16:16:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Sr3-0002n2-7p for submit@debbugs.gnu.org; Sat, 14 Oct 2017 16:16:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Sqx-00019d-C1 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 16:16:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43162) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3Sqx-00019V-8w for submit@debbugs.gnu.org; Sat, 14 Oct 2017 16:16:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3Sqw-0000P0-9k for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 16:16:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3Sqt-00016m-5m for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 16:16:10 -0400 Received: from [195.159.176.226] (port=46243 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3Sqs-00016A-Ul for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 16:16:07 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3Sqb-0000zq-Mi for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 22:15:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sat, 14 Oct 2017 21:15:41 +0100 Lines: 15 Message-ID: <86y3odo58y.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <86po9p93jz.fsf@gmail.com> <83d15piw5l.fsf@gnu.org> <86lgkd8uj8.fsf@gmail.com> <86h8v18scg.fsf@gmail.com> <83376lilpm.fsf@gnu.org> <86vajh4igr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) Cancel-Lock: sha1:RAGwcWiApUGnhZWljmZvPcBeuk0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Andy Moreton wrote: > On Sat 14 Oct 2017, Eli Zaretskii wrote: >> Thanks. However, I'm puzzled by the fact that it works here without >> any changes. > > Loading the troublesome images from "emacs -Q" also works in unmodified > emacs 26, so something in my init.el changes the behaviour. Further testing shows that my init.el has: (auto-image-file-mode 1) Removing that line fixes the problem. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 17:52:36 2017 Received: (at 28824) by debbugs.gnu.org; 14 Oct 2017 21:52:36 +0000 Received: from localhost ([127.0.0.1]:40595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3UMG-00058c-80 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 17:52:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3UME-00058L-P4 for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 17:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3UM5-0007gn-3q for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 17:52:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3UM4-0007gf-VV for 28824@debbugs.gnu.org; Sat, 14 Oct 2017 17:52:25 -0400 Received: from [2602:30a:2e52:d720:65b7:1416:12e7:8bfb] (port=60560 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1e3UM4-0006mv-EU; Sat, 14 Oct 2017 17:52:24 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pflJN81MXW" Content-Transfer-Encoding: 7bit Message-ID: <34582.83757.771697.23010@gargle.gargle.HOWL> Date: Sat, 14 Oct 2017 16:52:22 -0500 From: "Roland Winkler" To: Eli Zaretskii Subject: Re: bug#28824: 26.0.90; display of pbm images broken? In-Reply-To: <83376mjjq7.fsf@gnu.org> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --pflJN81MXW Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit On Sat Oct 14 2017 Eli Zaretskii wrote: > Works for me in Emacs 26.0.90 on MS-Windows. I used PBM images from > etc/images/ in the Emacs tree: does this fail to work for you with > those images as well? I need to apologize: the bug is not with pbm images, but with ppm images. (The tool I use to create them calls them pbm, but it gives ppm, pgm or pbm files depending on the content of the image.) Then I realized there seem to be different versions of ppm files. If I use the imagemagick tool `convert' to convert etc/images/home.pbm to a ppm file it gives me the attached file home-1bit.ppm. This one still displays fine. But if I export this file with gimp, it gives me the attached file home-8bit.ppm. This file illustrates the bug I am talking about. The file names refer to the output from the imagemagick tool `identify': $ identify home* home-1bit.ppm PPM 24x24 24x24+0+0 1-bit sRGB 1.84KB 0.000u 0:00.000 home-8bit.ppm PPM 24x24 24x24+0+0 8-bit sRGB 1.78KB 0.000u 0:00.000 PS: Visiting these files display them fine (according to the modeline, this uses imagemagick). The problem occurs with insert-image which appears to process these files differently --pflJN81MXW Content-Type: application/octet-stream; name="home-1bit.ppm" Content-Disposition: attachment; filename="home-1bit.ppm" Content-Transfer-Encoding: base64 UDYKIyBDUkVBVE9SOiBYViBWZXJzaW9uIDMuMTBhICBSZXY6IDEyLzI5Lzk0IChQTkcgcGF0Y2gg MS4yKQojIENSRUFUT1I6IFRoZSBHSU1QJ3MgUE5NIEZpbHRlciBWZXJzaW9uIDEuMAojCjI0IDI0 CjEKAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAA AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAA AAAAAQEBAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAAAAAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAAAAAAAAAAAAAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAQEBAAAA AQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAA AAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAQEBAQEBAQEBAQEBAQEBAAAAAAAAAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAQEBAAAAAAAAAAAAAQEBAQEBAQEB AAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAAAAAQEBAAAA AAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAAAAAAAAAAAAAAAAAAAAAQEBAAAAAQEB AQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAAAAAQEBAQEB AAAAAAAAAQEBAAAAAQEBAQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAA AQEBAQEBAAAAAQEBAQEBAAAAAAAAAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAAAAAAAAAQEBAAAAAQEBAQEBAAAAAAAAAQEBAQEBAAAAAAAAAQEBAQEBAAAA AAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAQEBAAAAAQEBAQEBAAAAAAAAAQEBAQEB AQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAAAAAQEB AQEBAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAAAAAQEBAAAAAQEBAQEBAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEB AQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAQEBAAAAAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAA AAAAAAAAAQEBAQEBAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAAAAAAAAAQEBAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAQEBAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEB --pflJN81MXW Content-Type: application/octet-stream; name="home-8bit.ppm" Content-Disposition: attachment; filename="home-8bit.ppm" Content-Transfer-Encoding: base64 UDYKIyBDUkVBVE9SOiBHSU1QIFBOTSBGaWx0ZXIgVmVyc2lvbiAxLjEKMjQgMjQKMjU1Cv////// //////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////wAAAAAAAP////////// /////////////////////////////////////////////////////wAAAAAAAAAAAAAAAP///wAA AAAAAAAAAAAAAP///////////////////////////////////////////////////////////wAA AP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////// /////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAP////////////// /////////////////////////////////////wAAAAAAAAAAAAAAAAAAAP///wAAAP///////wAA AAAAAAAAAP///////////////////////////////////////////////wAAAAAAAAAAAAAAAAAA AP///////////////////wAAAAAAAAAAAP////////////////////////////////////////// /wAAAAAAAAAAAP///////////////////////////////////wAAAAAAAP////////////////// /////////////////wAAAAAAAAAAAP///////////////////////////////////////wAAAAAA AAAAAP///////////////////////////wAAAAAAAP////////////////////////////////// /////////////////////wAAAAAAAP///////////////////wAAAAAAAP////////////////// /////////////////wAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAP///////////wAAAAAAAAAA AAAAAP///////////////////////////////wAAAP///////////wAAAP///wAAAAAAAAAAAAAA AP///////////////////wAAAP///////wAAAAAAAAAAAAAAAAAAAP///wAAAP///////////wAA AAAAAAAAAP///////////////////////////////wAAAP///////wAAAP///////wAAAAAAAP// /wAAAP///////////wAAAAAAAAAAAP///////////////////////////////wAAAP///////wAA AP///////wAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////// /////wAAAAAAAP///wAAAP///////wAAAAAAAP///////wAAAAAAAP///////wAAAAAAAP////// /////////////////////////wAAAAAAAP///wAAAP///////wAAAAAAAP////////////////// /////wAAAP///////////////////////////////////////wAAAP///wAAAP///////wAAAAAA AP///////////////////////wAAAP///////////////////////////////////////wAAAP// /wAAAP///////wAAAAAAAP///////////////////////wAAAP///////////////////////wAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AP///wAAAP///////////////////wAAAP///////////////////wAAAAAAAAAAAAAAAAAAAP// /////wAAAAAAAAAAAAAAAAAAAP///////////////wAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////// /////////wAAAAAAAAAAAP////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /////////////////w== --pflJN81MXW-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 13:43:02 2017 Received: (at submit) by debbugs.gnu.org; 15 Oct 2017 17:43:02 +0000 Received: from localhost ([127.0.0.1]:41845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3mwI-0004cO-1D for submit@debbugs.gnu.org; Sun, 15 Oct 2017 13:43:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3mwG-0004c2-Id for submit@debbugs.gnu.org; Sun, 15 Oct 2017 13:43:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3mw9-0003IZ-P5 for submit@debbugs.gnu.org; Sun, 15 Oct 2017 13:42:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3mw9-0003Hw-Lq for submit@debbugs.gnu.org; Sun, 15 Oct 2017 13:42:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3mw8-0003lG-Bn for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 13:42:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3mw5-0003C1-87 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 13:42:52 -0400 Received: from [195.159.176.226] (port=40966 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3mw5-00039z-0B for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 13:42:49 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3mvn-0004jn-Q6 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:42:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#28824: 26.0.90; display of pbm images broken? Date: Sun, 15 Oct 2017 18:42:27 +0100 Lines: 93 Message-ID: <86wp3w48ak.fsf@gmail.com> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <34582.83757.771697.23010@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cancel-Lock: sha1:PTZeGywNRe4T5QKG7J7dTt4y6NE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) On Sat 14 Oct 2017, Roland Winkler wrote: > On Sat Oct 14 2017 Eli Zaretskii wrote: >> Works for me in Emacs 26.0.90 on MS-Windows. I used PBM images from >> etc/images/ in the Emacs tree: does this fail to work for you with >> those images as well? > > I need to apologize: the bug is not with pbm images, but with ppm > images. (The tool I use to create them calls them pbm, but it gives > ppm, pgm or pbm files depending on the content of the image.) No problem - it lead me to find a different bug that also needed fixing. > $ identify home* > home-1bit.ppm PPM 24x24 24x24+0+0 1-bit sRGB 1.84KB 0.000u 0:00.000 > home-8bit.ppm PPM 24x24 24x24+0+0 8-bit sRGB 1.78KB 0.000u 0:00.000 > > PS: Visiting these files display them fine (according to the > modeline, this uses imagemagick). The problem occurs with > insert-image which appears to process these files differently Thanks for the example files. On Windows with a 64bit MSYS2 build of emacs 26 I also see the problems loading the home-8bit.ppm file. After some debugging, it appears that the problem was introduced in: commit 3c2c50260e19deff2a0a054882eaea4049f25a2f Author: Paul Eggert Date: Thu Sep 29 20:09:37 2016 -0700 This changed the raster data from using "unsigned char" to "char" which cannot be correct, as this is binary data. The trouble occurs when reading an 0xff byte from the raster data, which gets sign extended to r, g and b values (of type int) of -1. The following patch works for me (including the earlier fix): diff --git a/lisp/image.el b/lisp/image.el index 1d0776180b..32df508bc8 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -34,8 +34,8 @@ 'image-refresh (defconst image-type-header-regexps `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]\\(?:\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ \\)\\{2\\}" . pbm) ("\\`GIF8[79]a" . gif) ("\\`\x89PNG\r\n\x1a\n" . png) diff --git a/src/image.c b/src/image.c index 3dac7086cb..1d81da2663 100644 --- a/src/image.c +++ b/src/image.c @@ -5523,23 +5523,23 @@ pbm_load (struct frame *f, struct image *img) if (type == PBM_GRAY && raw_p) { - r = g = b = *p++; + r = g = b = *(uint8_t *) p++; if (max_color_idx > 255) - r = g = b = r * 256 + *p++; + r = g = b = r * 256 + *(uint8_t *) p++; } else if (type == PBM_GRAY) r = g = b = pbm_scan_number (&p, end); else if (raw_p) { - r = *p++; + r = *(uint8_t *) p++; if (max_color_idx > 255) - r = r * 256 + *p++; - g = *p++; + r = r * 256 + *(uint8_t *) p++; + g = *(uint8_t *) p++; if (max_color_idx > 255) - g = g * 256 + *p++; - b = *p++; + g = g * 256 + *(uint8_t *) p++; + b = *(uint8_t *) p++; if (max_color_idx > 255) - b = b * 256 + *p++; + b = b * 256 + *(uint8_t *) p++; } else { Eli can decide if reverting the previous "unsigned char" -> "char" changes is a better fix. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 14:49:34 2017 Received: (at 28824) by debbugs.gnu.org; 15 Oct 2017 18:49:34 +0000 Received: from localhost ([127.0.0.1]:41920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3nyg-0008Fk-50 for submit@debbugs.gnu.org; Sun, 15 Oct 2017 14:49:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3nyf-0008FX-7v for 28824@debbugs.gnu.org; Sun, 15 Oct 2017 14:49:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3nyW-0002sr-MT for 28824@debbugs.gnu.org; Sun, 15 Oct 2017 14:49:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3nyW-0002sl-Ic; Sun, 15 Oct 2017 14:49:24 -0400 Received: from [176.228.60.248] (port=1424 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3nyV-0000sU-Ev; Sun, 15 Oct 2017 14:49:24 -0400 Date: Sun, 15 Oct 2017 21:49:12 +0300 Message-Id: <83a80sgsbb.fsf@gnu.org> From: Eli Zaretskii To: Andy Moreton , Paul Eggert In-reply-to: <86wp3w48ak.fsf@gmail.com> (message from Andy Moreton on Sun, 15 Oct 2017 18:42:27 +0100) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <34582.83757.771697.23010@gargle.gargle.HOWL> <86wp3w48ak.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Andy Moreton > Date: Sun, 15 Oct 2017 18:42:27 +0100 > > Eli can decide if reverting the previous "unsigned char" -> "char" > changes is a better fix. Looks like going back to unsigned should be cleaner, but I'd like to hear what Paul thinks. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 04:30:19 2017 Received: (at 28824-done) by debbugs.gnu.org; 16 Oct 2017 08:30:19 +0000 Received: from localhost ([127.0.0.1]:42475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e40mw-0000dC-S0 for submit@debbugs.gnu.org; Mon, 16 Oct 2017 04:30:19 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e40mu-0000cz-LZ for 28824-done@debbugs.gnu.org; Mon, 16 Oct 2017 04:30:17 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DEBA8160062; Mon, 16 Oct 2017 01:30:09 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id UkGJmEbKI0oR; Mon, 16 Oct 2017 01:30:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A395F160071; Mon, 16 Oct 2017 01:30:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eso5SQ1OuJNu; Mon, 16 Oct 2017 01:30:08 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.18.85]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3F9C8160062; Mon, 16 Oct 2017 01:30:08 -0700 (PDT) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? To: Eli Zaretskii , Andy Moreton References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <34582.83757.771697.23010@gargle.gargle.HOWL> <86wp3w48ak.fsf@gmail.com> <83a80sgsbb.fsf@gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <6c4a985c-b0a1-93a4-8c3b-36f7c2f5721c@cs.ucla.edu> Date: Mon, 16 Oct 2017 01:30:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <83a80sgsbb.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------F9D14E69FB9D58E10B464B84" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28824-done Cc: 28824-done@debbugs.gnu.org, Roland Winkler X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------F9D14E69FB9D58E10B464B84 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Sun, 15 Oct 2017 18:42:27 +0100 >> >> Eli can decide if reverting the previous "unsigned char" -> "char" >> changes is a better fix. >=20 > Looks like going back to unsigned should be cleaner, but I'd like to > hear what Paul thinks. Andy's fixes look good to me. Going back to unsigned would result in seve= ral=20 pointer casts that are more dangerous than converting to unsigned. They c= an be=20 further improved by encapsulating this stuff into a function, and I insta= lled=20 the attached (the second one is Andy's other fix, which I installed in hi= s name). I looked for related bugs in image.c (i.e., caused by my earlier patch) a= nd did=20 not find any. --------------F9D14E69FB9D58E10B464B84 Content-Type: text/x-patch; name="0001-Fix-regression-in-display-of-PPM-images.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Fix-regression-in-display-of-PPM-images.patch" =46rom cac318a1fce0a4c8c5c1f81f715c06c49c117592 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Oct 2017 01:14:58 -0700 Subject: [PATCH 1/2] Fix regression in display of PPM images Problem reported by Roland Winkler (Bug#28824#35). Based on a patch proposed by Andy Moreton (Bug#28824#38). * src/image.c (pbm_scan_index): New function. (pbm_load): Use it to decode raw data correctly when its top bit is set. --- src/image.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/image.c b/src/image.c index cd4901b..335a43e 100644 --- a/src/image.c +++ b/src/image.c @@ -5277,6 +5277,25 @@ pbm_scan_number (char **s, char *end) return val; } =20 +/* Scan an index from *S and return it. It is a one-byte unsigned + index if !TWO_BYTE, and a two-byte big-endian unsigned index if + TWO_BYTE. */ + +static int +pbm_scan_index (char **s, bool two_byte) +{ + char *p =3D *s; + unsigned char c0 =3D *p++; + int n =3D c0; + if (two_byte) + { + unsigned char c1 =3D *p++; + n =3D (n << 8) + c1; + } + *s =3D p; + return n; +} + =20 /* Load PBM image IMG for use on frame F. */ =20 @@ -5499,7 +5518,8 @@ pbm_load (struct frame *f, struct image *img) else { int expected_size =3D height * width; - if (max_color_idx > 255) + bool two_byte =3D 255 < max_color_idx; + if (two_byte) expected_size *=3D 2; if (type =3D=3D PBM_COLOR) expected_size *=3D 3; @@ -5522,24 +5542,14 @@ pbm_load (struct frame *f, struct image *img) int r, g, b; =20 if (type =3D=3D PBM_GRAY && raw_p) - { - r =3D g =3D b =3D *p++; - if (max_color_idx > 255) - r =3D g =3D b =3D r * 256 + *p++; - } + r =3D g =3D b =3D pbm_scan_index (&p, two_byte); else if (type =3D=3D PBM_GRAY) r =3D g =3D b =3D pbm_scan_number (&p, end); else if (raw_p) { - r =3D *p++; - if (max_color_idx > 255) - r =3D r * 256 + *p++; - g =3D *p++; - if (max_color_idx > 255) - g =3D g * 256 + *p++; - b =3D *p++; - if (max_color_idx > 255) - b =3D b * 256 + *p++; + r =3D pbm_scan_index (&p, two_byte); + g =3D pbm_scan_index (&p, two_byte); + b =3D pbm_scan_index (&p, two_byte); } else { --=20 2.7.4 --------------F9D14E69FB9D58E10B464B84 Content-Type: text/x-patch; name="0002-Don-t-reject-PBM-header-whitespace-unnecessarily.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0002-Don-t-reject-PBM-header-whitespace-unnecessarily.patch" =46rom 000abe3c89b1934c23377a792a838f289d4bbf8a Mon Sep 17 00:00:00 2001 From: Andy Moreton Date: Mon, 16 Oct 2017 01:23:32 -0700 Subject: [PATCH 2/2] Don't reject PBM header whitespace unnecessarily * lisp/image.el (image-type-header-regexps): Allow two or more CRs or LFs in initial whitespace sequences. See: http://netpbm.sourceforge.net/doc/pbm.html --- lisp/image.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/image.el b/lisp/image.el index 1d07761..32df508 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -34,8 +34,8 @@ 'image-refresh (defconst image-type-header-regexps `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]\\(?:\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ \\)\\{2\\}" . pbm) ("\\`GIF8[79]a" . gif) ("\\`\x89PNG\r\n\x1a\n" . png) --=20 2.7.4 --------------F9D14E69FB9D58E10B464B84-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 11:12:25 2017 Received: (at 28824) by debbugs.gnu.org; 16 Oct 2017 15:12:25 +0000 Received: from localhost ([127.0.0.1]:43993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4744-0001cG-TA for submit@debbugs.gnu.org; Mon, 16 Oct 2017 11:12:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4743-0001c4-I7 for 28824@debbugs.gnu.org; Mon, 16 Oct 2017 11:12:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e473v-00006U-9x for 28824@debbugs.gnu.org; Mon, 16 Oct 2017 11:12:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e473v-00006N-79; Mon, 16 Oct 2017 11:12:15 -0400 Received: from [176.228.60.248] (port=1969 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e473u-0001yr-Dg; Mon, 16 Oct 2017 11:12:14 -0400 Date: Mon, 16 Oct 2017 18:11:58 +0300 Message-Id: <83tvyzf7pd.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-reply-to: <6c4a985c-b0a1-93a4-8c3b-36f7c2f5721c@cs.ucla.edu> (message from Paul Eggert on Mon, 16 Oct 2017 01:30:07 -0700) Subject: Re: bug#28824: 26.0.90; display of pbm images broken? References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <34582.83757.771697.23010@gargle.gargle.HOWL> <86wp3w48ak.fsf@gmail.com> <83a80sgsbb.fsf@gnu.org> <6c4a985c-b0a1-93a4-8c3b-36f7c2f5721c@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: andrewjmoreton@gmail.com, winkler@gnu.org, 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Cc: 28824-done@debbugs.gnu.org, Roland Winkler > From: Paul Eggert > Date: Mon, 16 Oct 2017 01:30:07 -0700 > > > Looks like going back to unsigned should be cleaner, but I'd like to > > hear what Paul thinks. > > Andy's fixes look good to me. Going back to unsigned would result in several > pointer casts that are more dangerous than converting to unsigned. They can be > further improved by encapsulating this stuff into a function, and I installed > the attached (the second one is Andy's other fix, which I installed in his name). > > I looked for related bugs in image.c (i.e., caused by my earlier patch) and did > not find any. OK, thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 11:22:51 2017 Received: (at 28824) by debbugs.gnu.org; 16 Oct 2017 15:22:51 +0000 Received: from localhost ([127.0.0.1]:44017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e47EB-0001tD-56 for submit@debbugs.gnu.org; Mon, 16 Oct 2017 11:22:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e47E9-0001sz-JV for 28824@debbugs.gnu.org; Mon, 16 Oct 2017 11:22:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e47E0-00087z-1P for 28824@debbugs.gnu.org; Mon, 16 Oct 2017 11:22:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e47Dz-00087r-T4; Mon, 16 Oct 2017 11:22:39 -0400 Received: from lukas.physics.niu.edu ([131.156.224.124]:42308 helo=lukas) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1e47Dz-0002sz-Dp; Mon, 16 Oct 2017 11:22:39 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <52926.79913.647647.23012@gargle.gargle.HOWL> Date: Mon, 16 Oct 2017 10:22:38 -0500 From: "Roland Winkler" To: Eli Zaretskii Subject: Re: bug#28824: 26.0.90; display of pbm images broken? In-Reply-To: <83tvyzf7pd.fsf@gnu.org> References: <29226.45866.855134.23009@gargle.gargle.HOWL> <83376mjjq7.fsf@gnu.org> <34582.83757.771697.23010@gargle.gargle.HOWL> <86wp3w48ak.fsf@gmail.com> <83a80sgsbb.fsf@gnu.org> <6c4a985c-b0a1-93a4-8c3b-36f7c2f5721c@cs.ucla.edu> <83tvyzf7pd.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28824 Cc: Paul Eggert , andrewjmoreton@gmail.com, 28824@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On Mon Oct 16 2017 Eli Zaretskii wrote: > > Cc: 28824-done@debbugs.gnu.org, Roland Winkler > > From: Paul Eggert Date: Mon, 16 Oct 2017 > > 01:30:07 -0700 > > > > I looked for related bugs in image.c (i.e., caused by my earlier > > patch) and did not find any. > > OK, thanks. Thanks for the quick fix. Proper handling of these images is so important for my everyday usage of emacs I'll have to wait for the next pretest to come out. From unknown Sun Aug 17 09:09:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Nov 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator