Jump to content

Problems in Working with GD library


impeccable_nice

Recommended Posts

hello,

  I have configured my GD library with PHP 4.3.2. But when I coded my first program which are using the resources provided by GD (infact that was just a simple rectangle). I could not see the desired output instead I have seen some letters on my browser. well I passed my own PNG header at the start of my code but I dont know why I could not see the rectangle, If you know then plz reply  ASAP
Link to comment
Share on other sites

Ok, reading back through your original post, I'm not following you 100%. So lets clear this up...

Originally, you used your code [i]without[/i] the header and your browser returned a bunch of text.
Then, you added the header and your browser returned the expected image.
You want to know why it does not work as expected without the header?

It does this as there is nothing telling the browser that it is an image, it's opening it as a plain text file I guess and unable to decode it correctly as it's not actually plain text. Therefore you add the header to tell the browser what to expect the file output to be. An alternative is to remove the header, and reference the file as an image in another script with the image tag: <img src="imagescript.php" alt="" border="0px"/>
Link to comment
Share on other sites


NO NO you are not getting my point . I know the story behind sending headers I sent my own header at line 2 which you can see but still I cant see the expected result (i-e a rectangle). So If you know what the problem realy is then plz reply ASAP.

I am not creating any anti spam key image, I just only want to check whether my GD library is properly working or not.
Link to comment
Share on other sites

Array
(
  [GD Version] => bundled (2.0.12 compatible)
  [FreeType Support] => 1
  [FreeType Linkage] => with freetype
  [T1Lib Support] =>
  [GIF Read Support] => 1
  [GIF Create Support] =>
  [JPG Support] => 1
  [PNG Support] => 1
  [WBMP Support] => 1
  [XBM Support] => 1
  [JIS-mapped Japanese Font Support] =>
)

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.