/usr/share/doc/libgd-gd2-perl/examples/demos/shapes.pl is in libgd-gd2-perl 1:2.46-3.1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #!/usr/bin/perl
use GD;
$im = new GD::Image(300,300);
($white,$black,$red,$blue,$yellow) =
(
$im->colorAllocate(255, 255, 255),
$im->colorAllocate(0, 0, 0),
$im->colorAllocate(255, 0, 0),
$im->colorAllocate(0,0,255),
$im->colorAllocate(255,250,205)
);
$im->transparent($white); # white color is transparent
$im->interlaced(1); # cool venetian blinds effect
# Create a flat wide rectangle paintbrush
$brush = new GD::Image(10,10);
$brush->colorAllocate(255,255,255); # white
$brush->colorAllocate(0,0,0); # black
$brush->transparent($white); # white is transparent
$brush->filledRectangle(0,0,5,2,$black); # a black rectangle
# Draw a friendly title (ha!)
$im->string(gdLargeFont,150,10,"Hello world!",$red);
$im->string(gdSmallFont,150,28,"Goodbye cruel world!",$blue);
$im->stringUp(gdTinyFont,280,250,"I'm climbing the wall!",$black);
$im->charUp(gdMediumBoldFont,280,280,"Q",$black);
# Draw an oval
$im->setBrush($brush);
$im->arc(100,100,100,150,0,360,gdBrushed);
$poly = new GD::Polygon;
$poly->addPt(30,30);
$poly->addPt(100,10);
$poly->addPt(190,290);
$poly->addPt(30,290);
$im->polygon($poly,gdBrushed);
$im->fill(132,62,$blue);
$im->fill(100,70,$red);
$im->fill(40,40,$yellow);
binmode STDOUT;
# print the image to stdout
print $im->png;
|