/usr/share/doc/libgd-gd2-perl/examples/demos/transform.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 | #!/usr/bin/perl
use GD;
# test scaling, translation, transformation
$im = new GD::Image(380,225);
$black = $im->colorAllocate(0, 0, 0);
$white = $im->colorAllocate(255, 255, 255);
$red = $im->colorAllocate(255, 0, 0);
$blue = $im->colorAllocate(0,0,255);
$yellow = $im->colorAllocate(255,250,205);
# Create a triangle
$poly = new GD::Polygon;
$poly->toPt(50,50);
$poly->toPt(100,0);
$poly->toPt(-50,50);
$poly->toPt(-50,-50);
$im->filledPolygon($poly,$yellow);
# Stretch it a bit
$poly->scale(1.8,1.0);
$poly->offset(100,0);
$im->filledPolygon($poly,$red);
# Rotate it
$poly->transform(0.55,0.20,0.0,1,-25,50);
$im->filledPolygon($poly,$blue);
binmode STDOUT;
print $im->png;
|