This is a discussion on imagegammacorrect within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I copy pasted this code from a book I just bought from Atkinson. The image is in the same folder ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I copy pasted this code from a book I just bought from Atkinson.
The image is in the same folder has the page. The page displays the string. What am I doing wrong ... again? <?php echo "In ima page\n"; //attempt to open image, suppress error messages if(!($image = @imagecreatefromjpeg("deuxpointdeux.jpg"))) { //error, so create an error image and exit $image = imagecreate(200,200); $colorWhite = imagecolorallocate($image, 255, 255, 255); $colorBlack = imagecolorallocate($image, 0, 0, 0); imagefill($image, 0, 0, $colorWhite); imagestring($image, 4, 10, 10, "Couldn't load image!", $colorBlack); header("Content-type: image/jpeg"); imagejpeg($image); exit(); } //adjust gamma, display inputimage, outputimage imagegammacorrect($image, 2.2, 1.571); //send image header("Content-type: image/jpeg"); imagejpeg($image); ?> -- Thanks for your attention. Jean Pierre Daviau -- Easyphp1.8 Apache1.3.24 DEVC++, borland 5.5 windows Xp asus p4 s533/333/133 Intel(R) Celeron (R) CPU 2.00 GHz http://www.jeanpierredaviau.com |
|
|||
|
Jean Pierre Daviau said the following on 22/03/2006 15:01:
> I copy pasted this code from a book I just bought from Atkinson. > > The image is in the same folder has the page. The page displays the string. > What am I doing wrong ... again? > <...SNIP CODE...> Read the PHP manual page for header() again, carefully... -- Oli |
|
|||
|
I tried this
if (!extension_loaded('gd')) { if (!dl('gd.so')) { print '<P>gd.so:False<BR>'; } }else print '<P>gd.so:True<BR>'; Answer: true. and a bunch of text ------------------------------------------- trueJFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality C $.' ",#(7),01444'9=82<.342C 2!!222222222222222222222222222222222222222222222 22222I" ĵ}!1AQa"q2'#BR$3 br, % ---------------------------------------------- |