diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 06c869d..a415275 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -44,7 +44,9 @@ class Configuration implements ConfigurationInterface ->scalarNode('interpolation')->defaultValue(true)->end() ->arrayNode('text_color')->prototype('scalar')->end()->end() ->arrayNode('background_color')->prototype('scalar')->end()->end() + ->arrayNode('background_images')->prototype('scalar')->end()->end() ->scalarNode('disabled')->defaultValue(false)->end() + ->scalarNode('ignore_all_effects')->defaultValue(false)->end() ->end() ; diff --git a/Generator/CaptchaGenerator.php b/Generator/CaptchaGenerator.php index 04e424d..0d653a7 100644 --- a/Generator/CaptchaGenerator.php +++ b/Generator/CaptchaGenerator.php @@ -125,6 +125,9 @@ class CaptchaGenerator $fingerprint = isset($options['fingerprint']) ? $options['fingerprint'] : null; + $this->builder->setBackgroundImages($options['background_images']); + $this->builder->setIgnoreAllEffects($options['ignore_all_effects']); + $content = $this->builder->build( $options['width'], $options['height'], diff --git a/README.md b/README.md index 8c4c95c..dfe42ac 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,9 @@ 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 +* **background_images**: Sets custom user defined images as the captcha background (1 image is selected randomly). It is recommended to turn off all the effects on the image (ignore_all_effects). The full paths to the images must be passed. * **interpolation**: enable or disable the interpolation on the captcha +* **ignore_all_effects**: Recommended to use when setting background images, will disable all image effects. Example :