Skip to content
Snippets Groups Projects
Commit 8cf500dd authored by soxofaan's avatar soxofaan
Browse files

made noise level more fine grained

parent c83209c5
No related branches found
Tags 6.x-2.0-beta4
No related merge requests found
......@@ -196,10 +196,13 @@ function image_captcha_settings_form() {
'#type' => 'select',
'#title' => t('Noise level'),
'#options' => array(
2 => t('low'),
5 => t('normal'),
7 => t('high'),
10 => t('severe'),
1 => t('1 - low'),
2 => '2',
3 => t('3 - medium'),
4 => '4',
5 => t('5 - high'),
7 => '7',
10 => t('10 - severe'),
),
'#default_value' => (int) variable_get('image_captcha_noise_level', 5),
);
......
......@@ -213,7 +213,7 @@ function _image_captcha_image_generator_add_lines(&$image, $width, $height, $col
}
function _image_captcha_image_generator_add_dots(&$image, $width, $height, $colors) {
$noise_quantity = ($width * $height)/2.0 * ((int) variable_get('image_captcha_noise_level', 5)) / 10.0;
$noise_quantity = $width * $height * ((int) variable_get('image_captcha_noise_level', 5)) / 10.0;
for ($i = 0; $i < $noise_quantity; $i++ ) {
imagesetpixel($image, mt_rand(0, $width), mt_rand(0, $height), $colors[array_rand($colors)]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment