GD2 and PHP4.4

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

It should be possible (as far as I know) to use createimagefromjpg('<urltoimage>');

In PHP4.3.11 it worked just fine, but now I use PHP4.4 and it is not working  

I only can do:
createimagefromjpeg('blafoo.jpg') (=same dir)

This function is also used in a plugin (LightBox) for Nuclues and with Nucleus  
is isn't working also.

Anybody a solution? (I *need* to load from url!).

I'm using Win2003, IIS6, PHP4.4 (cgi and isapi).
allow_url_fopen = on
safe-mode = off


Re: GD2 and PHP4.4

For testing I use this little script (called gd.php):

// image path
$image_path = $_GET['img'];
// load path
$img = LoadJpeg($image_path);
// output
header("Content-type: image/jpeg");
// exit...

function LoadJpeg($imgname)
     $im = @imagecreatefromjpeg($imgname); /* Attempt to open */
     if (!$im) { /* See if it failed */
         $im  = imagecreatetruecolor(150, 30); /* Create a black 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;


Maybe it is usefull to take a look and see if it works under different PHP  

Snef wrote:
Quoted text here. Click to load it

Site Timeline