Re: problem using imagejpeg function all

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, November 21, 2006 10:31 pm, Tom wrote:
>     I?m trying to use the imagejpeg function call in a php script and
> I
> can?t quite seem to get it working properly.

Can you clarify "working properly" into something a bit more concrete?

Right now, we're left guessing from the most likely scenario, that you
are seeing the:
yoya%#(*&H*(Y#@T...
on your screen, because you've commented out the "header" line to tell
the browser to expect an image, all the way up through "the aliens
attack and put me to sleep every time I reload" :-)

> Would I need to have T1Lib support in order for this it work?

No.

Only if you wanted to use the T1 font/string functions within GD would
you need the T1Lib support.

> As a quick example, here is some code I?ve been playing around with
> that I
> found somewhere.
>
> <?php
>  $image = imagecreate(200, 200);
>  $colorRed = imagecolorallocate($image, 255, 0, 0);
>  imagefill($image, 0, 0, $colorRed);

ImageFill might not do what you want with a new raw JPEG...

I mean, what color are all the pixels to start with?...

I would suggest that this is more suitable:
imagerectangle($image, 0, 0, 199, 199, $colorRed);

>  //send image
>  //header("Content-type: image/jpeg");

If you took this out for testing/debugging, that's great, but you have
to put it back in for the browser to know that it's a JPEG and not
HTML.

>  imagejpeg($image);

> Should make a red square.

What did it actually make?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux