This is a discussion on GD2 and PHP4.4 within the PHP Language forums, part of the PHP Programming Forums category; Hi, It should be possible (as far as I know) to use createimagefromjpg('<urltoimage>'); In PHP4.3.11 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
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 anymore! I only can do: createimagefromjpeg('blafoo.jpg') (=same dir) or createimagefromjpeg('d:/inetpub/vhosts/......../blafoo.jpg); 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!). PS I'm using Win2003, IIS6, PHP4.4 (cgi and isapi). allow_url_fopen = on safe-mode = off Thanx... |
|
|||
|
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"); imagejpeg($img); // exit... 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 versions... Snef wrote: > Hi, > > 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 anymore! > > I only can do: > createimagefromjpeg('blafoo.jpg') (=same dir) > or > createimagefromjpeg('d:/inetpub/vhosts/......../blafoo.jpg); > > 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!). > > PS > I'm using Win2003, IIS6, PHP4.4 (cgi and isapi). > allow_url_fopen = on > safe-mode = off > > Thanx... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|