captcha images don't appear anywhere they should. I have verified that GD and freetype are working.

i added a line to image_captcha.module to output the image to a file for testing

    // print the image as jpg to the client
    imagejpeg($image,"/tmp/test.jpg");
    imagejpeg($image); 

test.jpg gets created ok, and I can read it in an image viewer and use it to successfully verify the captcha challenge.

I commented out the line that prevents re-rendering

  // unset the code from $_SESSION to prevent rerendering the captcha
  //unset($_SESSION['image_captcha'][$seed]);

then I opened the image_captcha url manually in the browser.
The image did not display at all. I saved the image through the browser and opened it in xv. It looked like there were two extra newlines in front of the jpeg data. I remove the newlines and the jpeg opens fine in xv.

I have a feeling that there is some kind of header issue going on because when I comment out the drupal_set_header calls and open the captcha_image manually it displays binary garbage as expected, but if I save the page I get a clean jpeg.

I am using firefox, what can I do to troubleshoot this problem more?

Comments

dmill’s picture

Status: Active » Closed (fixed)

Well I noticed that I was getting the extra newlines on every page which led me to find that my settings.php had extra lines outside the .

This was not an issue with capthca, but an issue with how I formatted my settings.php

Image captcha works now yay!