Closed (fixed)
Project:
CAPTCHA
Version:
7.x-1.x-dev
Component:
Image Captcha (image_captcha)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Nov 2010 at 10:08 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
elachlan commentedOn closer inspection I found that the code length changes the width.
I see the $code_length attribute in image_captcha.module line 207
The change would be at line 223.
I was thinking something along the lines of:
I tested it and it doesn't work. Not sure how to fix it. I think I have to make sure $code_length is an int then convert both back to a string.
Comment #2
soxofaan commentedGood idea, but hardly a bug, more a feature request.
Anyway, this is the code that defines the image size (see function
_image_captcha_generate_imagein image_captcha.user.inc:For this issue, I would recommend to factor this code out in a function like
image_captcha_image_size()and then use this function in_image_captcha_generate_image()and inimage_captcha_captcha()Comment #3
elachlan commentedPatch with changes.
Comment #4
soxofaan commentedthat's fast :)
I didn't try the patch yet (only read it), but here is just a tip to make the code cleaner:
Also, the patch seems to introduces tab instead of spaces for indentation in image_captcha.module.
Comment #5
elachlan commentedChanges :)
Hopefully fixed!!
Comment #6
soxofaan commentedthanks for the update.
some remarks
in image_captcha_image_size:
-
$fonts = _image_captcha_get_enabled_fonts();is not needed I think-
$codeis used but not defined, there must be something wrong here.in _image_captcha_generate_image: still using $arr['width'] instead of list(width, ...)
Comment #7
elachlan commentedHopefully Fixed!!!
Changes it so that it requires the $Code parameter.
The code needs better comments, its hard to understand some of it.
Comment #8
soxofaan commentedHi elachlan,
I reworked your patch a bit: renamed to function "_image_captcha_image_size" (with leading underscore), moved it to image_captcha.module (from image_captcha.user.inc) and added a bit more documentation.
Committed: http://drupal.org/cvs?commit=456624
thanks for your work
Comment #9
elachlan commentedLove your work soxofaan! Thanks!