Jump to content

GD Library not working...HELP?


Moron

Recommended Posts

Okay, I get nothing but the little red 'x' when trying to display an image using the GD Library.

 

When I run:

 

<?php
var_dump(gd_info());
?>

 

...I get:

 

array(12) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }

 

JPG support is inded enabled in my PHP.ini file. I'm running PHP 5.

 

Anyone?

 

 

 

 

 

 

Link to comment
Share on other sites

Probably an error in the script. Try removing any content headers and the imagejpeg function and accessing the script directly (rather than loading it in an image tag) and see if you get any errors.

 

I'm using a different script now. No errors at all, but it displays the ASCII code for the image, not the image itself.

 

What will it take to make the GD Library work?

 

Link to comment
Share on other sites

That either means that no image type header was output or you are attempting to output image data directly on a web page instead of using a proper HTML <img src="..." tag.

 

In either case, you need to post your code so someone here can see what you are doing.

Link to comment
Share on other sites

When I'm playing with GD library I get the bulk written by not incorporating it into my script and just accessing it directly by typing the URL into the address bar much like GingerRobot says. That way I get to see error messages if any are generated and see my image when it works.

 

Once I'm happy with it I add it into my script and if at a later date I change something that kills it I simply access it directly in another browser tab again so I can see the error messages.

 

If phpinfo() shows GD library to be installed and you're not having much luck with it then start creating something basic like a rectangle and work from there.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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