Added "length" option and changed the parameters names

This commit is contained in:
Gregwar
2011-09-09 20:02:47 +02:00
parent 4a5b2a4c48
commit 4e59281467
5 changed files with 26 additions and 15 deletions

View File

@ -41,7 +41,7 @@ class CaptchaGenerator {
}
// Write CAPTCHA text
$size = $width/5.0;
$size = $width/strlen($this->value);
$font = __DIR__.'/Font/captcha.ttf';
$box = imagettfbbox($size, 0, $font, $this->value);
$txt_width = $box[2] - $box[0];