mad .... again jpeg files...
| From: | Miguel Loureiro | Date: | Tue, 04 Dec 2001 18:46:56 +0000 |
| Subject: | mad .... again jpeg files... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76567@lists.php.net to get a copy of this message | ||
Hello all,
I still having problem when use jpeg functions...
I got: " testout.jpg is not a valid JPEG file in .." , with follow
code:
Header("Content-type: image/jpeg");
$img=ImageCreateFromJPEG("testout.jpg");
ImageJPEG($img,"a.jpg");
ImageDestroy($img);
testout.jpg was one image created by jpeg-6b after make test, I see
image directly in browser
(machine_name/directory/where/have/code/testout.jpg) the image, my
phpinfo gives me information that gd had support for jpeg enabled .... I
try with other *.jpeg files .... I try this code:
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");
ImageDestroy($im);
and the result was an empty a.jpg file .....
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
If anyone has any idea ...
I already dont know what to do ....
T.Y.
--
Best Regards
Miguel Joaquim Rodrigues Loureiro