Closed (fixed)
Project:
CAPTCHA
Version:
5.x-3.x-dev
Component:
Image Captcha (image_captcha)
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
1 Nov 2007 at 21:16 UTC
Updated:
25 Apr 2008 at 10:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
smily commentedyes.. the font is very small and impossible to makeout what letters r there in the captcha.
so i uploaded a ttf font to the fonts folder: /modules/captcha/image_captcha/fonts and updated the settings with the new font in the Administer » User management » CAPTCHA » Image CAPTCHA. Now i dont see captcha image .. ( i did clear the cache & cookies and tried .. but no result). if i revert back to the default font .. only then the captcha works.. :(
pls help me solving this problem.
Comment #2
soxofaan commentedConcerning the small fonts/images: is that with the built-in font? The built-in font is only there to offer out of the box functionality, it is recommended however to use TTF fonts.
I guess your PHP GD library has no FreeType Support. see http://drupal.org/node/183608#comment-614940 for more info
It is generally a bad idea to put extra (contributed/third party) modules in the "modules/" directory of your drupal set-up. It is much better to put them in "sites/all/modules/". This will make upgrading your drupal installation much less painfull. Believe me, I made the same mistake too when I started with drupal, I won't do it anymore ;)
Comment #3
mdlueck commentedIndeed uploading a ttf font made a VAST improvement already. Thank you very much for that suggestion.
Any thoughts of how the site I mentioned got a yellowish background to the Captcha image?
Comment #4
soxofaan commentedThe yellowish background is not possible with the current Image CAPTCHA. I guess that site uses an old version of Image CAPTCHA or its predecessor MyCaptcha. The blueish characters on the yellowish background in these versions seemed a limitation to me, and its implementation was messy/not very efficient. That's why I changed it to a white background with multi colored characters in the current image CAPTCHA.
You should ask the admins of that site what they use.
Why do you want exactly that yellow/blue layout?
We might add an palette option to the image CAPTCHA, but that would be more in the line of "light characters on a black background" and "dark characters on a white background".
Comment #5
mdlueck commentedVery well, I will stick with what is at least working! ;-)
To me it seemed (the yellow background that is) to set that apart... draws attention to it / make it stick out on the page like a sour thumb. Our theme has white pages... I hope people will not miss it.
So, I will toss it into production next!
Comment #6
soxofaan commentedif you're not afraid of hacking a module, you can always jump into image_captcha.module and look for
(around line 435) and change the color
255, 255, 255to you preference.Comment #7
mdlueck commentedThanks for that pointer, I will keep it in mind. I do not care much for hacking... turns into a support nightmare.
Would you consider additional properties for the module and expose such configuration details through the admin interface?
Comment #8
robloachIt would be neat to give the user options to set........
The defaults would mimic the functionality that's in there right now, however you then would also have the option to reproduce what they are using on http://www.debuntu.org/contact by setting the background to yellow, the border to black, and the text color to purple.
Comment #9
robloachWhat if we made use of the Color module?
Comment #10
soxofaan commentedThe color module seems to be rather oriented towards themes and not much can be reused by modules.
I already tried an initial implementation of the admin GUI (see patch). It's only GUI stuff, the selected colors are not used in the image generation code.
But I'm not really happy with it: when the image generation will be finished it will be a lot of code for a minor feature and it adds jquery/javascript to the mix. The javascript was a lot of copy/pasting from the color module + minor addaptations.
I think it's not suited for long term maintainability, and we should be careful about this.
I would only do it if the color module could also be used by modules so that we can reuse code instead of copy/pasting.
Comment #11
soxofaan commentedInstead of implementing a colorpicker by our own, it would be better to use http://drupal.org/project/colorpicker
Comment #12
robloachWe'll have to gracefully degrade to something else if Color Picker isn't enabled. Simple text fields?
Comment #13
soxofaan commentedHere is a first simple patch for a reiteration of the concept:
just two hex-color textfields for background and foreground color.
todo: add (optional) randomness to the foreground color
Comment #14
soxofaan commentedfollow-up on #13:
added randomness to foreground color
Comment #15
soxofaan commentedin attachment the patch from #14 ported to the 6.x-1.x branch
feature is already committed to HEAD: http://drupal.org/cvs?commit=107556
Comment #16
soxofaan commentedfrom http://drupal.org/node/233873#comment-783556:
Good point
in attachment the new patches for DRUPAL-5--3 and DRUPAL-6--1
already committed to HEAD by http://drupal.org/cvs?commit=107720
Comment #17
soxofaan commentedfrom http://drupal.org/node/233873#comment-783556:
Well, if your background and foreground color are too close, you shouldn't set the color randomness too high. One could of course think of more complicated randomness schemes that take the closeness into account, but I assume that most users will take colors far enough from each other, or take low variation otherwise.
In the long term we could also add a fancy javascript color picker and such, but I just wanted to provide a simple but functional solution for this issue.
In further patches additional patches we could add the more advanced stuff if needed/requested.
About the double vision you use in your setup: do you really like that feature? I am consideringt dropping it because it seems very bad for usability, it's hard to explain it to normal human visitors. I've setup pol about it on http://groups.drupal.org/node/10168
Comment #18
soxofaan commentedhttp://drupal.org/cvs?commit=109285
http://drupal.org/cvs?commit=109288
Comment #19
CyberAngel commentedHi!
I have a question. How I doing to apply this patch to the my captcha?
I would change the background image without change the color in the image_captcha.module every time.
Thanks!
Comment #20
soxofaan commentedThe patch is already committed to CVS, so the feature is in the development snapshot of the module: http://drupal.org/node/158901
If you really want to patch, you can more information at http://drupal.org/patch/apply
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.