GNU bug report logs -
#37153
26.1; some png images scrambled on Windows
Previous Next
Full log
Message #50 received at 37153 <at> debbugs.gnu.org (full text, mbox):
> 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 <at> 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))
{
This bug report was last modified 3 years and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.