Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Captcha image Corrupted / Garbled
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
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
Since that looks absolutely nothing like the CAPTCHA I get on Liferay, I'm guessing it's a JBOSS related thing.
Actually, this is more or less the default captcha with a custom dictionary, different color scheme, and some CSS.
My captcha-ext.properties is:
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..
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..
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.
.gif image/gif, etc.