Hello, Does this debian bug have to do something related to the following issue? I had the following problem on a debian.
----------------------------- ZF <[email protected]> date Thu, Nov 12, 2009 at 5:20 PM subject captcha text is missing mailed-by gmail.com hide details Nov 12 Hello, I have a strange issue related to Zend_Form's Captcha element. I use image captchas in some of the forms. But sometimes the text/code in the captcha image is missing although the image is generated. Here is a sample captcha image: http://img91.imageshack.us/img91/1746/b6f01afeb4d7d2464f81982.png Any idea about this? sc ----------------------------- On Tue, Dec 15, 2009 at 9:18 PM, Alayn Gortazar <[email protected]> wrote: > Ok, > I finally found a solution, it was the custom captcha adapter what had to be > passed as 'captcha' option instead of the options array. > Almost went nuts on this... > > // Add a captcha > $this->addElement('captcha', 'captcha', array( > 'label' => 'write next 5 characters:', > 'required' => true > 'captcha' => new My_Captcha_Image(array( > 'captcha' => 'Image', > 'font' => APPLICATION_PATH . '/fonts/Arial_Bold.ttf', > 'imgUrl' => '/images/captcha', > 'fontSize' => 30, > 'wordLen' => 5, > 'timeout' => 300 > )), > )); > $this->captcha->addPrefixPath('My_Captcha', 'My/Captcha/', 'captcha'); > > By the way, if anyone is using Debian. It seems that there is a casting bug > or something like that in the imageftbbox function and returns -2147483648 on > some of the coordinate numbers. (I suppose it may happen on other systems > too...), > > I had to make this change to have the Image captcha working as it must, > that's why I extend and overrided the _generateImage($id,$word) function: > Change: > $texbox = imageftbbox($fsize, 0, $font, $word); > With: > do{ > $textbox = imageftbbox($fsize, 0, $font, $word); > }while(($textbox[2] == -2147483648)); > > > Cheers, > > -- > Alayn Gortazar > > ----- "Alayn Gortazar" <[email protected]> escribió: > >> Hi everybody, >> I'm trying to use a custom captcha adapter extending and overriding >> the Zend_Captcha_Image adapter. >> >> The trouble is that when I try to use this adapter, Zend throws the >> next Exception: >> >> ============================== >> Message: Plugin by name '' was not found in the registry; used paths: >> Zend_Captcha_: Zend/Captcha/ >> ============================== >> >> The code I'm using inside a Zend_Form class looks like this: >> ============================= >> // Add a captcha >> $this->addElement('captcha', 'captcha', array( >> 'label' => 'write next 5 characters:', >> 'captcha' => array( >> 'captcha' => new My_Captcha_Image(), >> 'font' => APPLICATION_PATH . '/fonts/Arial_Bold.ttf', >> 'imgUrl' => '/images/captcha', >> 'fontSize' => 30, >> 'wordLen' => 5, >> 'timeout' => 300 >> ), >> )); >> >> $this->captcha->addPrefixPath('My_Captcha','My/Captcha','captcha'); >> ============================== >> >> Any idea of what I'm doing wrong?? >> >> -- >> Alayn Gortazar >
