Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
captcha-3375835
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
captcha-3375835
Commits
8cf500dd
Commit
8cf500dd
authored
15 years ago
by
soxofaan
Browse files
Options
Downloads
Patches
Plain Diff
made noise level more fine grained
parent
c83209c5
No related branches found
Branches containing commit
Tags
6.x-2.0-beta4
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
image_captcha/image_captcha.admin.inc
+7
-4
7 additions, 4 deletions
image_captcha/image_captcha.admin.inc
image_captcha/image_captcha.user.inc
+1
-1
1 addition, 1 deletion
image_captcha/image_captcha.user.inc
with
8 additions
and
5 deletions
image_captcha/image_captcha.admin.inc
+
7
−
4
View file @
8cf500dd
...
...
@@ -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
),
);
...
...
This diff is collapsed.
Click to expand it.
image_captcha/image_captcha.user.inc
+
1
−
1
View file @
8cf500dd
...
...
@@ -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
)]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment