[Configuration] Added JPEG quality node (fixes #13)
This commit is contained in:
@ -83,6 +83,12 @@ class CaptchaType extends AbstractType
|
||||
*/
|
||||
protected $font;
|
||||
|
||||
/**
|
||||
* Captcha quality
|
||||
* @var int
|
||||
*/
|
||||
protected $quality;
|
||||
|
||||
/**
|
||||
* Maximum age of images in minutes
|
||||
* @var int
|
||||
@ -117,6 +123,7 @@ class CaptchaType extends AbstractType
|
||||
$this->gcFreq = $config['gc_freq'];
|
||||
$this->expiration = $config['expiration'];
|
||||
$this->font = $config['font'];
|
||||
$this->quality = $config['quality'];
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilder $builder, array $options)
|
||||
@ -136,7 +143,7 @@ class CaptchaType extends AbstractType
|
||||
$fingerprint = $this->session->get($this->key.'_fingerprint');
|
||||
}
|
||||
|
||||
$generator = new CaptchaGenerator($this->generateCaptchaValue(), $this->imageFolder, $this->webPath, $this->gcFreq, $this->expiration, $this->font, $fingerprint);
|
||||
$generator = new CaptchaGenerator($this->generateCaptchaValue(), $this->imageFolder, $this->webPath, $this->gcFreq, $this->expiration, $this->font, $fingerprint, $this->quality);
|
||||
|
||||
if ($this->asFile) {
|
||||
$view->set('captcha_code', $generator->getFile($this->width, $this->height));
|
||||
|
Reference in New Issue
Block a user