GD2 and PHP4.4

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Snef

    GD2 and PHP4.4

    Hi,

    It should be possible (as far as I know) to use createimagefrom jpg('<urltoimag e>');

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

    I only can do:
    createimagefrom jpeg('blafoo.jp g') (=same dir)
    or
    createimagefrom jpeg('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...
  • Snef

    #2
    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($imgna me)
    {
    $im = @imagecreatefro mjpeg($imgname) ; /* Attempt to open */
    if (!$im) { /* See if it failed */
    $im = imagecreatetrue color(150, 30); /* Create a black image */
    $bgc = imagecoloralloc ate($im, 255, 255, 255);
    $tc = imagecoloralloc ate($im, 0, 0, 0);
    imagefilledrect angle($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
    createimagefrom jpg('<urltoimag e>');
    >
    In PHP4.3.11 it worked just fine, but now I use PHP4.4 and it is not
    working anymore!
    >
    I only can do:
    createimagefrom jpeg('blafoo.jp g') (=same dir)
    or
    createimagefrom jpeg('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...

    Comment

    Working...