Re: problem with ImageCreateJPEG ...

From: Date: Tue, 04 Dec 2001 14:22:13 +0000
Subject: Re: problem with ImageCreateJPEG ...
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-76521@lists.php.net to get a copy of this message
sorry for taking your time, but I still dont understand why I got errors with pjeg... I use the following code on other machine with jpeg support to , and it works, while in my machine I got an empty jpeg file <? Header("Content-type: image/jpeg"); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,"--- OK ---",$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,"a.jpg"); ?> <html> <body> <img src="a.jpg"> </body> </html> Try to remove all html, and instead make a ImageJPEG($img);
You should then only get the JPEG file? You set a header, and the browser doesn't understand the HTML... regards Johan

« previous php.general (#76521) next »