Captcha image there but no letters!

12 years 3 weeks 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:
header('Content-Type: image/jpeg');
imagejpeg($image);
with:
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 to join the conversation.

12 years 3 weeks 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 to join the conversation.

12 years 3 weeks ago - 12 years 3 weeks 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.

Please Log in to join the conversation.

12 years 3 weeks 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 to join the conversation.

12 years 3 weeks 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:

header('Content-Type: image/jpeg');
imagejpeg($image);
with:
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 to join the conversation.

12 years 3 weeks 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.238 seconds

Facebook Twitter LinkedIn