I've just tried to post an anonymous comment five times in a row. I succeeded on the fifth because it was the first time that the captcha module actually put all of the captcha text inside of the graphic. Is this thing actually working for anyone? And, if so, how did you get it working properly? The number of characters displayed seems to range between one and five, but the only time it worked it was five characters.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | textimage.patch_0.txt | 4.33 KB | stefano@tipic.com |
Comments
Comment #1
stefano@tipic.com commentedThe attached patch fixes the problem with margins and also a problemi with noise (lines, dost, ellipses). It seems that the image create using imagecreatetruecolor() doesn't show noise, I tried imagecreate() and it works.
Comment #2
hyperlogos commentedWhat version/release of textimage did you apply your patch to?
I really despise the fact that drupal download filenames (e.g. for modules) don't have a version number in them. Muy estupido.
Comment #3
wundo commentedComment #4
hyperlogos commentedThis is against CVS, the last one was against 4.7.0, you are either patching an already-patched copy, or the cvs version now on the site is broken. In any case, it seems to be working properly with cvs.
Comment #5
splatEric commentedHi, I found that the reason the patch wasn't applying correctly was because the file from CVS had a mixture of different carriage returns in it. To resolve this, I performed the following regexp in vi:
:%s/^M$//g
note that to get ^M you must use ctrl+v ctrl+m, NOT carrat M.
Once I had done this, the patch command worked fine, and the next captcha attempt I made worked perfectly. Note that I simply had to replace the textimage.module file - there was no need to reapply the module, or update or anything like that.
Of course ymmv, but it worked for me
Comment #6
craines commentedI just downloaded and installed textimage and captcha (both CVS) and did have the issue with text appearing outside the boundary of the captcha image -- so it appears as though the CVS (for some reason) doesn't include this patch.
Patching the CVS (dated 25/08/2006) by hand got it to work for us.
Comment #7
SemperFideles commentedI cannot, for the life of me, figure out what I'm doing wrong.
Here's what I've done:
1. Tried installing textimage.module from the latest CVS release. Out of bounds problem persists.
2. Tried downloading the original file and then applying the patch in the attached file (textimage.patch_0.txt). The CAPTCHA actually displays correctly but then the settings for textimage do not work properly anymore.
Is there an actual stable, working release of textimage.module that works? I can use the patched version of my file because it displays the image string properly but then I have a problem that I can no longer administer the textimage module.
Comment #8
Steel Rat commentedThis is still happening in the 2.x dev from the 4.7.x modules page. Is there a reason why the files don't get updated when an "official" patch is put out? A lot of extraneous messages and user pain could be avoided if they were.
Comment #9
peterx commentedI added textimage 1.13 and captcha 1.30 to a 5.0 site. Same problem as with a 4.7 site. The adjustment that works on my sites is to replace:
with:
The 100 and 50 may depend on the font, which means we have to increase both numbers as people report problems. It would be wise to record the reasons for the numbers. I use the default font on a Windows 2000 development system, test, then upload to hosts on unspecified *nux and test again. The settings of 100 and 50 work on my development system and some hosted sites.
Comment #10
hyperlogos commentedIf the settings depend on the font then textimage will need some SERIOUS updating as you can install multiple fonts. The size of the image needs to be self-tuning if the character spacing etc is going to be based on the font in question.
Comment #11
Steel Rat commentedCaptcha has been totally un-usable to me because of this issue. When will the download be fixed?
Comment #12
mrb commentedHere's a fix to the problem that is a bit more general. Note that it only affects the code for people using the built-in font. I'm not sure if there needs to be any work on the code that uses true-type fonts to build the image.
If the captcha-string is N characters long, the widest that the captcha-string image will be in pixels is:
= (N * max width of a character) + ((N-1) * max gap between characters)
= (N * 10) + ((N-1) * $charSpacingMax))
I am not 100% sure that '10' is the correct max width of a character, but that is what is used in the current code, and it seems to work ok.
So in captcha.inc, function _textimage_captcha_image(), replace the line
with
With the original code, if I displayed ten captcha images, only four of them showed the whole string. After the patch, all the captcha images showed the whole string.
Comment #13
eMPee584 commentedI also had this problem using a font file called 'skinck__.ttf'.. using the latest (image_captcha.module,v 1.1.4.22 2007/10/11 08:38:25) captcha modudule the following changes to function _image_captcha_generate_image made it look fine (as you can see at http://www.muntu-afrika.de/kontakt):
it seems this is heavily dependant on the font you use.. though I don't think we are going to change from skinck as that looks quite cool already (see above).
Comment #14
eMPee584 commented... I have added a configurable space tuning parameter in the patch at http://drupal.org/node/233873, if this approach does not work for anyone reopen this for the captcha module.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.