Re: mad .... again jpeg files...
| From: | Valentin V. Petruchek | Date: | Tue, 04 Dec 2001 18:47:12 +0000 |
| Subject: | Re: mad .... again jpeg files... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76569@lists.php.net to get a copy of this message | ||
Try to specify absolute path to the jpeg - possible php do not look up for
jpeg in current folder...
(or use './image.jpg')
Zliy Pes, http://zliypes.com.ua
----- Original Message -----
From: "Miguel Loureiro" <m.loureiro@nextvision.pt>
To: "php-gen" <php-general@lists.php.net>
Sent: Tuesday, December 04, 2001 8:46 PM
Subject: [PHP] mad .... again jpeg files...
> 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
>
>
>
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net