Skip Menu |

This queue is for tickets about the Prima CPAN distribution.

Report information
The Basics
Id: 64777
Status: resolved
Priority: 0/
Queue: Prima

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Image noX11 drawing
Date: Sat, 15 Jan 2011 03:10:43 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With recent debian packaged Prima 1.28 the docs of Prima::Image invite Prima::noX11, but it seems drawing operations don't work in that case. The program below makes an all-black /tmp/foo.png where I expected white with a green square, which can be had by removing the Prima::noX11. Are there limits on what Prima::Image can do without a server? use strict; use warnings; use Prima::noX11; use Prima; my $image = Prima::Image->create (width => 100, height => 100); $image->begin_paint; $image->color (cl::White); $image->bar (0,0, 99,99); # background $image->color (cl::Green); $image->bar(10,10,30,30); $image->end_paint; $image->save('/tmp/foo.png') or die "Error saving:$@\n"; system "zgv -z /tmp/foo.png"; exit 0;
Птн Янв 14 11:10:49 2011, user42@zip.com.au писал: Show quoted text
> With recent debian packaged Prima 1.28 the docs of Prima::Image invite > Prima::noX11, but it seems drawing operations don't work in that case.
True, they don't - and that's intended, because all drawing goes through X11, except individual pixel read/write operations, that don't need begin_paint/end_paint bracket anyway. The docs invite noX11's use because of Image loading and saving, nothing else.
Subject: Re: [rt.cpan.org #64777] Image noX11 drawing
Date: Sat, 15 Jan 2011 05:53:49 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"KARASIK via RT" <bug-Prima@rt.cpan.org> writes: Show quoted text
> > True, they don't - and that's intended, because all drawing goes through > X11, except individual pixel read/write operations,
Such as the pixel() method? The few lines below are still all black for me, with noX11 in there. Show quoted text
> The docs invite noX11's use because of Image loading and saving, > nothing else.
It could say that. I thought it was a way to do some file-only drawing. The drawing ops could throw an error if they can't do what they should. Silently doing nothing is a bit mysterious. That could include missing begin_paint too, as I've been bitten by forgetting that and having nothing come out, or only pixel() as you said. use strict; use warnings; use Prima::noX11; use Prima; my $image = Prima::Image->create (width => 3, height => 3); $image->begin_paint; $image->pixel(1,1, cl::Green); $image->end_paint; $image->save('/tmp/foo.png') or die "Error saving:$@\n"; system "zgv -z /tmp/foo.png"; exit 0;
Show quoted text
> > The docs invite noX11's use because of Image loading and saving, > > nothing else.
> > It could say that. I thought it was a way to do some file-only drawing.
That's a good point. I've had ideas to make Prima work with GD so drawing outside begin_paint could do some useful stuff, but that didn't happen. I'll make a change in the doc.