Jump to content

serblowa

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by serblowa

  1. So still no luck. I have tried some sample code online that appears to work. I have tried calling my php script from an html file and I still can't get any kind of image to display. So I am wondering if there is a minimum system requirement to get GD2 to work properly. I am using an old computer (Celeron 2Ghz with 256MB of RAM), and I am wondering if GD2 just needs more resources. I tried looking for some documentation on this and found nothing.

     

    Does anyone know if this could possibly be the problem?

  2. Well I enabled error logging and removed the @ sign, but still no luck. I entered some obviously wrong code and the error logger did show an error. However, I'm not seeing any errors when I execute the code segment above. I tried opening the script in several browsers, and I did find that Firefox threw the following error:

     

    Error: Image corrupt or truncated: http://192.168.0.176/simplegraph

    Source File: http://192.168.0.176/simplegraph

    Line: 0

     

     

  3. Hello,

     

    I'm fairly new to PHP, and I'm trying to get the GD2 library working but I am having no luck. I have installed the library, and when I run phpinfo(); it shows that it is up and running, and all file types are supported. However, when I run the following code snippet nothing is displayed:

     

    <?php

      $im = @imagecreate (200, 100) or die ( "cannot create a new gd image.");

      $background_color = imagecolorallocate ($im, 240, 240, 240);

      $border_color = imagecolorallocate ($im, 50, 50, 50);

      $text_color = imagecolorallocate ($im, 233, 14, 91);

      imagerectangle($im,0,0,199,99,$border_color);

      imagestring ($im, 5, 10, 40, "a simple text string", $text_color );

      header ("content-type: image/png");

      imagepng ($im);

    ?>

     

    I have been struggling with this for a couple of weeks now with no luck. Any help would be greatly appreciated.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.