SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: GD Issues

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GD Issues

    I'm exec the following code from the PHP site:

    PHP Code:
    header ("Content-type: image/jpeg");
    $im = @imagecreatetruecolor(50100) or die("Cannot Initialize new GD image stream");
    $text_color imagecolorallocate($im2331491);
    imagestring($im155,  "A Simple Text String"$text_color);
    imagejpeg($im);
    imagedestroy($im); 
    However, the output is simply the url of the page.

    This has been a recurring issue I'm just no revisiting. I can't even tell if GD is installed (though I only get "Call to undefined function" errors with imagecreate, imagecreatefromgif functions). Other times I get this type of output. This is not my site but a friends whom I'm trying to fix.

    Any solutions?

    Thanks.

    Tim Trice

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably because GD is not installed, try to see the output of phpinfo(). In Firefox, if the image is broken, I believe it would show the URL string instead.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the output is not the url of the page, thats just what your browser displays.

    right click > view source to see the output of the page. or just stop sending the header so you can debug more easily.

  4. #4
    SitePoint Addict peterb's Avatar
    Join Date
    Jun 2003
    Location
    Athens, Greece
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I threw that on my server and it produced a black box with red text, no problem.

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it was a GD issue. Fortunately, the host allowed me to restart the server w/ the lib installed so it wasn't too bad of a deal. Much better than I feared.

    Definately expected an error output from PHP like the others. Threw me for a twist seeing the URL there...didn't realize it could be FF.

    Thanks for input guys.

    Tim Trice


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •