Hi,
Mmm.. got a weird problem :/
http://members.domain.com/cgi-bin/art/page.cgi?p=test
...thats using exactly the same code.
Images are:
http://www.domain.pro/images/badges/badgeXL500.png
http://www.domain.pro/images/badges/badgeMD500.png
http://www.domain.pro/images/badges/badgeSM500.png
http://www.domain.pro/images/badges/badgeXL.png
http://www.domain.pro/images/badges/badgeMD.png
http://www.domain.pro/images/badges/badgeSM.png
The code is pretty bog standard:
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/badge
+XL500.png|;
} elsif ($size eq "m") {
$filename = qq|/home/domain/domain.pro/www/images/badges/badge
+MD500.png|;
} elsif ($size eq "s") {
$filename = qq|/home/domain/domain.pro/www/images/badges/badge
+SM500.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;
..however, its confusing the hell out of me with whats going on with the text color. Could it have something to do with the pallet of the image?
TIA!
Andy
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.