<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Richard Knop&#039;s Zend Framework Blog &#187; Zend_Captcha_Image</title>
	<atom:link href="http://blog.richardknop.com/tag/zend_captcha_image/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richardknop.com</link>
	<description>Zend Framework, PHP, MySQL, jQuery, JavaScript, AJAX, SEO, E-commerce and more</description>
	<lastBuildDate>Mon, 06 Sep 2010 15:49:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Making Zend_Captcha_Image easier to read</title>
		<link>http://blog.richardknop.com/2009/12/making-zend_captcha_image-easier-to-read/</link>
		<comments>http://blog.richardknop.com/2009/12/making-zend_captcha_image-easier-to-read/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:58:25 +0000</pubDate>
		<dc:creator>Richard Knop</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Captcha_Image]]></category>

		<guid isPermaLink="false">http://blog.richardknop.com/?p=530</guid>
		<description><![CDATA[Sometimes people will complain that the captcha is too difficult to read and they have to reload the page in order to be able to pass the captcha test. If you are not willing to say goodbye to the very flexible Zend_Captcha_Image there are only two ways how to make it easier to read: Use [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes people will complain that the captcha is too difficult to read and they have to reload the page in order to be able to pass the captcha test. If you are not willing to say goodbye to the very flexible Zend_Captcha_Image there are only two ways how to make it easier to read:</p>
<ol>
<li>Use different font (I have found that Arial is sometimes hard to read, a good replacement seems to be LBRITED.TTF).</li>
<li>Set lower dot and line noise level.</li>
</ol>
<p>You can use &#8220;dotNoiseLevel&#8221; and &#8220;lineNoiseLevel&#8221; to tune down the captcha noise (and surpisingly this is not mentioned in the Zend Framework documentation):</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$captcha</span> <span class="sy0">=</span> <span class="kw2">new</span> Zend_Form_Element_Captcha<span class="br0">&#40;</span><span class="st0">&#39;captcha&#39;</span><span class="sy0">,</span> <span class="kw3">array</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;label&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;Captcha&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;helper&#39;</span> <span class="sy0">=&gt;</span> <span class="kw2">null</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;captcha&#39;</span> <span class="sy0">=&gt;</span> <span class="kw3">array</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;captcha&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;Image&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;wordLen&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">5</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;timeout&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">300</span><span class="sy0">,</span> <span class="co1">// 5 minutes timeout</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;font&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;fonts/LBRITED.TTF&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;fontSize&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">20</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;width&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">100</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;height&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">60</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;imgDir&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;images/captcha/&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;imgUrl&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;/images/captcha/&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;dotNoiseLevel&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">15</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;lineNoiseLevel&#39;</span> <span class="sy0">=&gt;</span> <span class="nu0">1</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Above I went over the top perhaps. Nevertheless, you must be able to find a compromise so that the users will be happy and the security side of your website won&#8217;t suffer too much.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardknop.com/2009/12/making-zend_captcha_image-easier-to-read/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
