I have a font (skinck) which needed manual messing with the width/height of the image in the user.inc.. now finally converted that into a space tuning parameter (others seem to have similar issues with various fonts); also added a setting to invert the colors, i.e. output light characters on black background. Simple but until colourpicker is ported and integrated, better than nothing.

Comments

soxofaan’s picture

Status: Needs review » Needs work

The color issue is already being addressed in http://drupal.org/node/188599#comment-769835, be welcome to test this

Regarding the spacing issue: can you provide a font with the problem you describe to test this?

eMPee584’s picture

StatusFileSize
new33.52 KB

here's the font I use. I am currently trying the other patch.

soxofaan’s picture

Title: patch: add simple 'invert colors' switch and font space tuning parameter » patch: font space tuning parameter
Assigned: eMPee584 » soxofaan
StatusFileSize
new3.78 KB

The patch from http://drupal.org/node/188599#comment-769911 (for 5.x-3.x) will probably not work on your 6.x-1.x setup. But you can check out the screenshot ;) . Please comment in that thread.
I will try to make a patch for 6.x-1.x

I tried your font and could reproduce the problem (e.g. see attachment: code is 5 characters long, but only 4 are visible)
I will have a look on how to fix this.
Or can you redo your patch without the color invert stuff?

soxofaan’s picture

Component: Image Captcha (image_captcha) » Code
Status: Needs review » Needs work
StatusFileSize
new4.33 KB
new4.16 KB

In attachment a patch for a revamped character placement (requires patch from http://drupal.org/node/188599#comment-782753 to be applied first)

The new implementation is more robust to the size issues like with the font from #2 (see example image, compare with #3)
No additional settings (like font space tuning param) are needed.

(already committed to HEAD: http://drupal.org/cvs?commit=107607)

soxofaan’s picture

Component: Code » Image Captcha (image_captcha)
Status: Needs work » Needs review

-

eMPee584’s picture

Component: Code » Image Captcha (image_captcha)
Status: Needs work » Needs review

hi soxofaan,
just checked out the CVS version, seems to work but even when setting character spacing to large, the resulting captcha (with large font size) just fits exactly, with less it doesn't. Also I do not quite understand the new bounding box code *g
Another thing, the color randomization does not ensure enough contrast between back- and foreground (which should imho rather been named text) color, I have set background to #000000 and foreground to #008000; with moderate randomization sometimes one character is way to dark (of course my foreground color is but I thought I'd try.. it's kinda more cool then my hack it actually gives a fitting captcha to my theme, see http://hfopi.org/contact) .. and well the double vision color is too near the foreground color too..
last but not least, I also just had converted the patch to 6.x but hey double effort means coding training for both of us huh ;)
cya

eMPee584’s picture

StatusFileSize
new1.52 KB

and here's the space tuning patch without the invert colors stuff, though I doubt it helps very much ;)

soxofaan’s picture

but even when setting character spacing to large, the resulting captcha (with large font size) just fits exactly, with less it doesn't.

Well, the problem lies with the font, it returns something bigger than requested. I don't believe it's the CAPTCHA module's job to support all possible corner cases of oversized/weird fonts, the image generating code is already kinky enough ;)
With the right settings it is however possible to get something usable with your font, so I wouldn't stretch this issue further.

I'll comment on the color issues in the related thread http://drupal.org/node/188599

soxofaan’s picture

StatusFileSize
new4.76 KB

new version of patch from #4 with better documentation

soxofaan’s picture

Version: 6.x-1.x-dev » 5.x-3.x-dev
Status: Needs review » Patch (to be ported)

committed to DRUPAL-6--1 branch: http://drupal.org/cvs?commit=112558

soxofaan’s picture

Status: Patch (to be ported) » Fixed

committed to DRUPAL-5--3 branch: http://drupal.org/cvs?commit=112571

eMPee584’s picture

hey soxofaan-- the last changes you committed to the 5.x branch fixed this once and for all... for the first time the whole code with this font is shown without me manually messing with the width and height parameters.. some characters run out of the image for a few pixels but it ain't no problem. Now my only issue left is contrast between double-vision shadow code and background color, but that's so minor i might not even do a patch myself. Looks good, thx!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.