RE: Captcha image Corrupted / Garbled

thumbnail
1553989, modified 16 Years ago. Junior Member Posts: 75 Join Date: 11/7/08 Recent Posts
Wondering if anyone else has experienced this and has a solution.

We're using captcha in several places on our site. It seems that quite frequently we get a very garbled image, as if something went wrong with the image processing.

I've noticed that no where in the liferay or the simple captcha settings is JAVA AWT set to headless mode (I've set alas, with not improvments - however, AFAIK, I've had long term issues when doing image processing without having that set)

Attached are examples of garbled and ungarbled images, so you understand what I mean.

Anyone have any ideas what might be wrong or any config that might be tweaked?

I'm using Liferay 5.1.1 running on JBoss.

Thanks,

Jim
thumbnail
2401061, modified 16 Years ago. Liferay Legend Posts: 2034 Join Date: 3/5/09 Recent Posts
Since that looks absolutely nothing like the CAPTCHA I get on Liferay, I'm guessing it's a JBOSS related thing.
thumbnail
1553989, modified 16 Years ago. Junior Member Posts: 75 Join Date: 11/7/08 Recent Posts
Actually, this is more or less the default captcha with a custom dictionary, different color scheme, and some CSS.

My captcha-ext.properties is:

cap.border=yes
cap.border.c=0,0,0,0
cap.border.th=1

cap.font.color=255,255,255
cap.noise.c=0,0,0

cap.background.c.to=0,0,0,0
cap.background.c.from=0,0,0,0

cap.image.height=50
cap.image.width=280


Since my original post, I've practically rewritten every class for SimpleCaptcha with our own custom Obfuscation, Distortion, Noise, WordRenderer, WordGenerator - and the only thing I've not changed is the underlying framework. I needed a more hardened CAPTCHA, thus I had to randomize Distortion, Noise, Fonts, Sizing and fix a placement bug in the original distro. The issue happens a lot less frequently since the rewrite, thus, I'm almost convinced it's an issue of poor cleanup.

Another possibility, which I've not pursued yet, is that the headers sent by the captcha image servlet are wrong. The mime type is sent as text/html, which might be related, but not sure yet..
thumbnail
2401061, modified 16 Years ago. Liferay Legend Posts: 2034 Join Date: 3/5/09 Recent Posts
Try changing your mime type to something "image-y" and see if that doesn't fix it. I can see where some other code might come into play and try to "render" your "text".

.gif image/gif, etc.