Skip to Content Skip to Menu

Captcha image there but no letters!

  • Riba
  • Riba
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
12 years 1 month ago #195974 by Riba
Replied by Riba on topic Re: Captcha image there but no letters!
Just wanted to let everyone know that I have found the fix.
It seems that the problem is there only if jpeg image is used, there are no problems with png. Replace the following code in captchasecurityimages.php:
Code:
header('Content-Type: image/jpeg'); imagejpeg($image);
with:
Code:
header('Content-Type: image/png'); imagepng($image);

It was a tough one to find as no errors were reported, but this does the trick. Root cause is till unknown, probably something to do with the type library and jpeg encoding, but who cares. Hoe it helps others.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 25531
  • Thanks: 1830
  • Karma: 877
12 years 1 month ago #195986 by nant
Replied by nant on topic Re: Captcha image there but no letters!
Wow - that is weird!

Thank you for posting solution - wish we could figure out cause.

Please Log in or Create an account to join the conversation.

  • Riba
  • Riba
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
12 years 1 month ago - 12 years 1 month ago #195988 by Riba
Replied by Riba on topic Re: Captcha image there but no letters!
Hmmm, the plot thickens! I was completely off track. :( While testing I was reloading the captcha image (right click - reload image) and checking the differences between my test script that works and this one that does not. I appeared that it started appearing after switching to PNG (as that is what the test script is using), but it turns out that the letters become visible after reloading it a couple of times regardless of the output format. If I keep reloading it every now and then a blank one comes up. Unfortunately the first image after the page load is always blank. I will keep testing and report back once I figure out what goes on. BTW other CMS systems using captcha suffer from the same problem.
Last edit: 12 years 1 month ago by Riba.

Please Log in or Create an account to join the conversation.

  • Riba
  • Riba
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
12 years 1 month ago #195989 by Riba
Replied by Riba on topic Re: Captcha image there but no letters!
As the text seems to disappear at random intervals, I tried setting the fixed string as that is the one random thing that changes but it hasn't made a difference.

Please Log in or Create an account to join the conversation.

  • koengland
  • koengland
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
12 years 1 month ago #195991 by koengland
Replied by koengland on topic Re: Captcha image there but no letters!

Riba wrote: Just wanted to let everyone know that I have found the fix.
It seems that the problem is there only if jpeg image is used, there are no problems with png. Replace the following code in captchasecurityimages.php:

Code:
header('Content-Type: image/jpeg'); imagejpeg($image);
with:
Code:
header('Content-Type: image/png'); imagepng($image);

It was a tough one to find as no errors were reported, but this does the trick. Root cause is till unknown, probably something to do with the type library and jpeg encoding, but who cares. Hoe it helps others.


Good work! Kate,

Please Log in or Create an account to join the conversation.

  • Riba
  • Riba
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
12 years 1 month ago #195992 by Riba
Replied by Riba on topic Re: Captcha image there but no letters!
Okay, it seems this is the cause:
bugs.php.net/bug.php?id=51315

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn