GD2 and PHP4.4

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-28-2006
Snef
 
Posts: n/a
Default GD2 and PHP4.4

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...
Reply With Quote
  #2 (permalink)  
Old 07-28-2006
Snef
 
Posts: n/a
Default 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");
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...

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0