my $size = lc($IN->param('size')) || "m"; print qq|Content-type: image/png \n\n|; # print "FOO"; use GD; my $filename; if ($size eq "l") { $filename = qq|/home/domain/domain.pro/www/images/badges/badgeXL500.png|; } elsif ($size eq "m") { $filename = qq|/home/domain/domain.pro/www/images/badges/badgeMD500.png|; } elsif ($size eq "s") { $filename = qq|/home/domain/domain.pro/www/images/badges/badgeSM500.png|; } # create a new image # my $im = new GD::Image(100,100); my $im = GD::Image->new( $filename ); # allocate some colors my $black = $im->colorAllocate(0,0,0); if ($size eq "l") { $im->string(gdMediumBoldFont,27,44,"Secure " . GT::Date::date_get() ,$black); } elsif ($size eq "m") { $im->string(gdMediumBoldFont,29,26,"Secure " . GT::Date::date_get(),$black); } elsif ($size eq "s") { $im->string(gdTinyFont,15,26,"Safe " . GT::Date::date_get() ,$black); } # make sure we are writing to a binary stream binmode STDOUT; # Convert the image to PNG and print it on standard output print $im->png;