image width is too small to display large font like korean.
so, I just increased the width of image. and, this looks quite good in english character.

diff -ur captcha/image_captcha/image_captcha.module captcha.fix/image_captcha/image_captcha.module
--- captcha/image_captcha/image_captcha.module  2007-08-30 04:18:34.000000000 +0900
+++ captcha.fix/image_captcha/image_captcha.module      2007-10-05 23:40:01.000000000 +0900
@@ -369,7 +369,7 @@
   $font_size = (int) variable_get('image_captcha_font_size', 30);
   $characters = _image_captcha_utf8_split($code);
   $character_quantity = count($characters);
-  $width = 1.2 * $font_size * $character_quantity;
+  $width = 1.5 * $font_size * $character_quantity;
   $height = 2 * $font_size;
 
   // create image resource

Comments

robloach’s picture

Status: Active » Reviewed & tested by the community

It seems alright with me.

soxofaan’s picture

does
$width = 1.4 * $font_size * $character_quantity;
also work for that font?

I wouldn't make that scale factor too big, because the bigger the images, the more resources you waste to the spammers.

beside that, it's ok for me

Hyunwoo’s picture

StatusFileSize
new24.35 KB

some letters(3 characters at 20 image generation) are cut at "1.4" as you can see in attached picture. but, no cut letters in "1.5".

I think admin should select the value in admin menu...

robloach’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.78 KB

The attached patch will add a "Character spacing" option to the Image Captcha settings screen that will allow you to change this value. Mind reviewing it?

robloach’s picture

This patch turns the textfield into a combo box. Even though it's not as user friendly, I think I still like the textfield more because you have complete control over the value.

soxofaan’s picture

StatusFileSize
new3.72 KB

I reworked the patch from #5 a bit, mainly UI layout/structure tweaks:

  • moved the character spacing from distortion settings to font settings
  • put font settings (font file, size and spacing) in a "Font settings" fieldset
  • put code settings (character set and code length) in "Code settings" fieldset
robloach’s picture

Title: too small image for large font(like korean font). » Too small image for large fonts (like Korean)
Status: Needs review » Fixed

Nice one! I like having everything in fieldsets.

Anonymous’s picture

Status: Fixed » Closed (fixed)