I am still trying to get GD to work on my system, but you need to output a
header:

header("Content-type: image/jpg");

then at the end:

imageJPG($im);

It should work if I'm not wrong...

"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Using PHP 4.1.1. / Apache / Win 98
>
> I'd like to use a .jpg from another URL - say:
>
> http://www.blah.com/foo.jpg
>
> and turn it into a variable using PHP and then once it is a variable to
try
> to manipulate that image using GD Libraries which are installed.
>
> Is this possible?
>
> I tried placing the string of the URL into a variable like:
>
> $theoldimage="http://www.blah.com/foo.jpg";;
>
> and then calling this function of:
>
> $thenewimage=imagecreatefromjpeg ($theoldimage);
>
> but it did not return a value when I echo'ed
>
> $thenewimage
>
> Many thanks for any advice.
> Tony Ritter
> ..................................................................
>
> function LoadJpeg ($imgname) {
>     $im = @imagecreatefromjpeg ($imgname); /* Attempt to open */
>     if (!$im) { /* See if it failed */
>         $im  = imagecreate (150, 150); /* Create a blank image */
>         $bgc = imagecolorallocate ($im, 255, 255, 255);
>         $tc  = imagecolorallocate ($im, 0, 0, 0);
>         imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
>         /* Output an errmsg */
>         imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc);
>     }
>     return $im;
> }
>
>
>



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

Reply via email to