From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: mituharu@math.s.chiba-u.ac.jp Newsgroups: gmane.emacs.bugs Subject: bug#37153: 26.1; some png images scrambled Date: Sat, 24 Aug 2019 18:01:46 +0900 Message-ID: <9c4c68ebe20cbcc44763be8e72bd25eb.squirrel@weber.math.s.chiba-u.ac.jp> References: <5b006777-5e97-a641-6f93-83a437ca9ca7@cs.ucla.edu> <44134.15891.158963.23904@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29899"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.22-5.el6 Cc: 37153@debbugs.gnu.org, Paul Eggert To: "Roland Winkler" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 24 11:02:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i1RwP-0007d5-Ix for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Aug 2019 11:02:33 +0200 Original-Received: from localhost ([::1]:36532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1RwN-0000KE-0f for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Aug 2019 05:02:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44986) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1Rvx-0000Jk-Dw for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 05:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1Rvv-00062O-He for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 05:02:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i1Rvu-00061Z-DH for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 05:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i1Rvu-0006zf-77 for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 05:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: mituharu@math.s.chiba-u.ac.jp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2019 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37153 X-GNU-PR-Package: emacs Original-Received: via spool by 37153-submit@debbugs.gnu.org id=B37153.156663730926854 (code B ref 37153); Sat, 24 Aug 2019 09:02:02 +0000 Original-Received: (at 37153) by debbugs.gnu.org; 24 Aug 2019 09:01:49 +0000 Original-Received: from localhost ([127.0.0.1]:41564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1Rvh-0006z4-1n for submit@debbugs.gnu.org; Sat, 24 Aug 2019 05:01:49 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:64128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1Rve-0006yr-Mb for 37153@debbugs.gnu.org; Sat, 24 Aug 2019 05:01:47 -0400 Original-Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id BAB34F091D; Sat, 24 Aug 2019 18:01:46 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Original-Received: from 58.89.58.6 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Sat, 24 Aug 2019 18:01:46 +0900 In-Reply-To: <44134.15891.158963.23904@gargle.gargle.HOWL> X-Priority: 3 (Normal) Importance: Normal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165759 Archived-At: > On Fri Aug 23 2019 Paul Eggert wrote: >> Do you see the same problem when using Emacs master? If not, then >> perhaps we can just marked the bug as fixed in the next release. > > The problem with my test png image is that it has transparent parts > that need to be displayed with a light color so that one can > recognize the nontransparent dark parts. But the image uses fully > transparent black as background. The behavior in such a case is not > strictly defined by the png standard, see > > https://sourceforge.net/p/png-mng/mailman/message/36747189/ > > Emacs displays such fully transparent background with its original > color specified by the image. But I believe it would make more > sense if emacs used instead a background color that the user can > choose (the background color of the frame), similar to, for example, > eog. I suspect there is a longstanding typo (or thinko) in PNG transparency handling code. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/src/image.c b/src/image.c index 81d8cb4e2b2..819e058f7e1 100644 --- a/src/image.c +++ b/src/image.c @@ -6680,7 +6680,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) /* Create an image and pixmap serving as mask if the PNG image contains an alpha channel. */ if (channels == 4 - && !transparent_p + && transparent_p && !image_create_x_image_and_pixmap (f, img, width, height, 1, &mask_img, 1)) {