Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] mad .... again jpeg files...

0 views
Skip to first unread message

Valentin V. Petruchek

unread,
Dec 4, 2001, 1:47:12 PM12/4/01
to PHP
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.lou...@nextvision.pt>
To: "php-gen" <php-g...@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...@lists.php.net
> For additional commands, e-mail: php-gene...@lists.php.net
> To contact the list administrators, e-mail: php-lis...@lists.php.net


0 new messages