 |
~Bean~ Level: Big Cheese

 Registered: 07-04-2003 Posts: 22
|
Re: Problem with ImageCreateFromJPEG
Yeah give it a try...I did end up trying it and it does work...
http://www.b34n.com/public/php/gd/gd_test.php
PHP Image
(Content header MUST be the first thing on the page...whitespace and even Session commands can cause issues!)
<?php
Header("Content-type: image/jpeg");
$pic=ImageCreate(100,100);
$col1=ImageColorAllocate($pic,128,128,128);
$col2=ImageColorAllocate($pic,255,0,0);
ImageFilledRectangle($pic,1,1,50,50,$col2);
Imagestring($pic, 2, 5, 75, "PHP Rocks!", $col2);
ImageJPEG($pic,"",90);
ImageDestroy($pic);
?>
|
The HTML
<html>
<head>
</head>
<body>
Here's the Image...
<img src="makeimg.php" border=0>
Nice, eh?
</body>
</html>
|
like I said, perhaps best used if you're creating on the fly and dont want to have to worry about misc files sitting on your server...
____________________________
Eggheads unite! You have nothing to lose but your yolks.
|
|
29-04-2005 at 11:43 PM |
|
|
|
|
 |
 |