codeigniter/captcha helper/image sometimes pads too much on left -
using "out-of-the-box" captcha helper codeigniter no trouble except, making "word" 2 5-letter long random strings (ex. wdrth iftbg)
occasionally, image drawing lot of "padding" left of first string, resulting in second string running off image. may cut last character in half, or may cut off completely, resulting in 5-letter/4-letter image although db value correctly 5 , 5.
i have "refresh value" option, when cuts down 5 , 4 looks normal user , won't understand why value won't validate.
is there anyway control padding when image drawn?
tia!
i have not used codeigniter captcha in quite time, "padding" sometimes see desirable captcha because want image appear random.
you should change settings in configuration allow more room digits, or use less digits, or try different font.
taken ci 1.7.1 source:
// once loaded can generate captcha this: $vals = array( 'word' => 'random word', 'img_path' => './captcha/', 'img_url' => 'http://example.com/captcha/', 'font_path' => './system/fonts/texb.ttf', // increase value allow more room digits 'img_width' => '150', 'img_height' => 30, 'expiration' => 7200 );
honestly it's been long since i've used this, should check out latest version 1 of these days (we're on 2.0.2).
some other interesting reads:
Codeigniter captcha helper is a great functionality for adding captcha validation, it is really simple. Here is an example: https://www.cloudways.com/blog/captcha-in-codeigniter/
ReplyDelete