in reply to Re: GD:image resolution issue
in thread GD:image resolution issue
Thanks for your quick response!
I tried it but i still get an internal server error
#!/usr/local/bin/perl use GD; use CommonSubs; $user = $ENV{'REMOTE_USER'}; %availableCards = ("card1" => "/tech/performance-culture +/rewards/images/ecards-master/large_card_1.png", "card2" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_2.png", "card3" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_3.png", "card4" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_4.png", "card5" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_5.png", "card6" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_6.png", "card7" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_7.png", "card8" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_8.png", "card9" => "/tech/p +erformance-culture/rewards/images/ecards-master/large_card_9.png"); $cardToUse = $availableCards{'card7'}; $text = "Hello Cy,\nGreat job! You are an asset to Cisco\nand your org +anization.\nRegards,\nCarlo"; @lines = split(/\n/, $text); $lCnt .= $#lines+1; $lineStart = 80; $lineHeight = 24; $container = "/opt/httpd/root-wwwin/htdocs".$cardToUse; $font = "/opt/httpd/root-wwwin/data-priv-shared/ops/web/LPG/templ/verd +ana.ttf"; $image = GD::Image->newFromPng($container,1); $txtColor = $image->colorResolve(0,0,0); for ($i=0; $i<$lCnt; ++$i){ $xPos = 375; $yPos = $lineStart + ($lineHeight*$i); @bounds = $image->stringTTF($txtColor,$font,13,0,$xPos,$yPos,@line +s[$i]); } $ts = time(); $imgFile = "ecard_".$user."_".$ts.".png"; open(IMGFILE, ">/opt/httpd/root-wwwin/data-shared/tech/artg/cust-touch +/videos/$imgFile"); binmode IMGFILE; print IMGFILE $image->png; close (IMGFILE); $img = "<img border=0 src=\"/data-shared/tech/artg/cust-touch/videos/$ +imgFile\" />"; print "Content-type: text/html\n\n"; print "$img";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: GD:image resolution issue
by ikegami (Patriarch) on Aug 11, 2010 at 16:15 UTC |