Skip Menu |

This queue is for tickets about the Image-Imlib2 CPAN distribution.

Report information
The Basics
Id: 12296
Status: rejected
Priority: 0/
Queue: Image-Imlib2

People
Owner: Nobody in particular
Requestors: tim.esselens [...] gmail.com
Cc:
AdminCc:

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

Attachments


Subject: Polygon created visual artifacts
Change the value in $bezier->curve(), to see other artifacts, The jpg (see attachment) was created with the following code: use Image::Imlib2; use Math::Bezier; my $width = 300; my $height = 250; my $graphwidth = 250; my $graphheight = 200; my $grid = 10; my $dx = ($width - $graphwidth)/2; my $dy = ($height - $graphheight)/2; my @control = ( 0, 100, 10, 200, 20, 20, 30, 20, 40, 20, 50, 20, 60, 20, 70, 99, 80, 80, 90, 76, 100, 45, 110, 46, 120, 47, 130, 47, 140, 47, 150, 47, 160, 47, 170, 47, 180, 47, 190, 47, 200, 47, 210, 47, 220, 47, 230, 200, 240, 200); my $bezier = Math::Bezier->new(\@control); my $points = $bezier->curve(148); my $poly = Image::Imlib2::Polygon->new(); $poly->add_point($dx,$graphheight+$dy); my $lastx; while (@$points) { my ($x, $y) = splice(@$points, 0, 2); $lastx = $x; # print "$x,$y\n"; $poly->add_point($x+$dx,$height-$y-$dy); } $poly->add_point($lastx+$dx,$height-$dy); $lastx = 0; my $img = Image::Imlib2->new($width,$height); $img->has_alpha(1); $img->set_color(255, 255, 255, 255); $img->fill_rectangle(0,0,$width,$height); $img->set_color(0, 0, 0, 127); $img->set_color(78,130,225,127); $poly->fill(); $img->draw_polygon($poly, 1); $img->save('imlib-artifacts.jpg');
imlib-artifacts.jpg
From: Tim Esselens
Software + versions affected by the above bug: Perl 5.8.5 imlib2 1.2.0.004 Image::Imlib2 1.06
Yuck, I see. Unfortunately that's a problem in the underlying C library. What to do, what to do...
From: Tim Esselens
Show quoted text
> What to do, what to do...
I spoke to raster on irc, It's a known issue in polygon.c This is a summary of the conversation: in the imlbi2 src, the TODO file has: * line code doesnt draw nice liens when clipping - fix * filled polygons can break fill bounds on corner cases - fix as 2 of the items and at the bottom... evas2 has fixed code for these 2 in it that work just fine. just need to port over (should be fairly easy). :) so we know its been in the TODO for ages and the fix is to steal evas's line and poly code but it justhasnt been done :) as imlib2 is not a priority for us atm
On Wed Apr 27 03:56:33 2005, guest wrote: Show quoted text
> as imlib2 is not a priority for us atm
This is a problem with the underlying C library, so there's not much we can do. Leon