From c21bbf13c5576b4a40093ad10060c08b8f580894 Mon Sep 17 00:00:00 2001 From: Gregwar Date: Wed, 24 Apr 2013 18:11:08 +0200 Subject: [PATCH] Adding interpolation option --- DependencyInjection/Configuration.php | 1 + Generator/CaptchaGenerator.php | 2 ++ README.md | 1 + composer.json | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 6d72a7f..bac834d 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -41,6 +41,7 @@ class Configuration implements ConfigurationInterface ->scalarNode('distortion')->defaultValue(true)->end() ->scalarNode('max_front_lines')->defaultValue(null)->end() ->scalarNode('max_behind_lines')->defaultValue(null)->end() + ->scalarNode('interpolation')->defaultValue(true)->end() ->arrayNode('background_color')->prototype('scalar')->end() ->end() ; diff --git a/Generator/CaptchaGenerator.php b/Generator/CaptchaGenerator.php index 4da833a..e419580 100644 --- a/Generator/CaptchaGenerator.php +++ b/Generator/CaptchaGenerator.php @@ -107,6 +107,8 @@ class CaptchaGenerator $this->builder->setBackgroundColor($color[0], $color[1], $color[2]); } + $this->builder->setInterpolation($options['interpolation']); + $fingerprint = isset($options['fingerprint']) ? $options['fingerprint'] : null; $content = $this->builder->build( diff --git a/README.md b/README.md index 907ecb6..33ee8fa 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ You can define the following configuration options globally or on the CaptchaTyp * **max_front_lines**, **max_behind_lines**: the maximum number of lines to draw on top/behind the image. `0` will draw no lines; `null` will use the default algorithm (the number of lines depends on the size of the image). (default=null) * **background_color**: sets the background color, if you want to force it, this should be an array of r,g &b, for instance [255, 255, 255] will force the background to be white +* **interpolation**: enable or disable the interpolation on the captcha Example : diff --git a/composer.json b/composer.json index 9b80a7d..827a379 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { "php": ">=5.3.0", - "gregwar/captcha": "v1.0.4" + "gregwar/captcha": "v1.0.5" }, "autoload": { "psr-0": {