9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] page/png bug
@ 2006-07-08 16:22 Federico G. Benavento
  2006-07-09 18:52 ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Federico G. Benavento @ 2006-07-08 16:22 UTC (permalink / raw)
  To: 9fans

there is a bug with .png's in page(1) and png(1)

hget http://plan9.escet.urjc.es/iwp9/banner.png | page
hget http://plan9.escet.urjc.es/iwp9/banner.png | png
(note you wont see the bug if you're not using a 32bpp display)

this doesn't happen in abaco because it doesn't draw the image that png(1)
outputs directly on the screen, it first draws it on a RGB24 image
and then draws that image on the screen

	// fd is png(1)'s stdout
	i = readimage(display, fd, 1);
	i2 = allocimage(display, i->r, RGB24, 0, DNofill);
	draw(i2, i2->r, display->black, nil, ZP);
	draw(i2, i2->r, i, nil, i->r.min);
	freeimage(i);
	// now i2 can be draw correctly on the screen

this is not a patch, because I don't know wether png(1) should output
an image that can be draw directly on the screen or page and png (without -d)
should use 2 images.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] page/png bug
  2006-07-08 16:22 [9fans] page/png bug Federico G. Benavento
@ 2006-07-09 18:52 ` Russ Cox
  2006-07-09 19:09   ` Federico G. Benavento
  2006-07-09 23:19   ` quanstro
  0 siblings, 2 replies; 4+ messages in thread
From: Russ Cox @ 2006-07-09 18:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Would you mind describing the bug beyond
saying "look at this file"?

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] page/png bug
  2006-07-09 18:52 ` Russ Cox
@ 2006-07-09 19:09   ` Federico G. Benavento
  2006-07-09 23:19   ` quanstro
  1 sibling, 0 replies; 4+ messages in thread
From: Federico G. Benavento @ 2006-07-09 19:09 UTC (permalink / raw)
  To: 9fans

> Would you mind describing the bug beyond
> saying "look at this file"?

it's not about minding or not, it's about having the ability
to do it.

well, I'll try anyway, the bug presents itself differently
with the problematic images, in the one I posted
IWP9's logo the background is white while the rest
appears violet, some other images look screwed
and nothing like what they should look like.

Federico G. Benavento



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] page/png bug
  2006-07-09 18:52 ` Russ Cox
  2006-07-09 19:09   ` Federico G. Benavento
@ 2006-07-09 23:19   ` quanstro
  1 sibling, 0 replies; 4+ messages in thread
From: quanstro @ 2006-07-09 23:19 UTC (permalink / raw)
  To: 9fans

russ,

i posted a little bit on this.  the problem is these two lines in png.c:

 165 		if(defaultcolor && screen->depth>8 && outchan==CMAP8)
 166 			outchan = RGB24;

if they are commented out (and i think if you replace RGB24 with RGBA32),
the image appears correctly.  using the v flag also works (for the wrong reasons).

the problem is in the conversion from the ABGR rawimage to RGB24.  i hadn't
narrowed down where the problem occurs.

- erik

On Sun Jul  9 13:55:28 CDT 2006, rsc@swtch.com wrote:
> Would you mind describing the bug beyond
> saying "look at this file"?
>
> Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-09 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-08 16:22 [9fans] page/png bug Federico G. Benavento
2006-07-09 18:52 ` Russ Cox
2006-07-09 19:09   ` Federico G. Benavento
2006-07-09 23:19   ` quanstro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).