in reply to GD segfault

The segfault is caused by the fill function. Your image is 25 x 25 pixels; the coordinate system starts at 0 and ends at 24, so 25 is just one position too much. A fence-post error, if you will.

Here's the new version of your code, cleaned up slightly (I had nothing better to do. Sue me):
#!/usr/local/bin/perl -w use strict; use GD; my %arcdata = ( topRight => [ 0, 24, 50, 50, 270, 360 ], topLeft => [ 24, 24, 50, 50, 180, 270 ], bottomRight => [ 0, 0, 50, 50, 0, 90 ], bottomLeft => [ 24, 0, 50, 50, 90, 180 ] ); for my $orientation ( keys %arcdata ) { my @insertdata = @{ $arcdata{$orientation} }; my $img = new GD::Image (25, 25); my $white = $img->colorAllocate(255,255,255); $img->transparent($white); my $black = $img->colorAllocate(0,0,0); $img->arc(@insertdata, $black); my $red = $img->colorAllocate(255,0,0); $img->fill( @insertdata[0,1], $red); open (IMAGEOUT,">$orientation.png") || die "Can't write to $or +ientation.png: $!\n"; binmode (IMAGEOUT); print IMAGEOUT $img->png(); close (IMAGEOUT); print "wrote $orientation.png\n"; }


ar0n ]