cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Updated: CaptchaReader
Date Sat, 18 Mar 2006 19:20:21 GMT
A document has been updated:

Document ID: 687
Branch: main
Language: default
Name: CaptchaReader (unchanged)
Document Type: Sitemap Component (previously: Cocoon Document)
Updated on: 3/18/06 7:15:18 PM
Updated by: Bruno Dumon

A new version has been created, state: publish

This part has been removed.

Long description
This part has been added.
Mime type: text/xml
File name: null
Size: 3366 bytes

<p>The <tt>CaptchaReader</tt> is a simple reader generating JPEG images
for the
text supplied as its source in a way so that it's hard to parse automatically.

<p><em>CAPTCHA</em> means quite literally <em>Completely Automated
Public Turing
Test to Tell Computers and Humans Apart</em> and one of the best resources on
this can be found at the <a href="">Carnegie Mellon
School of Computer Science CAPTCHA project.</a>.</p>

<p>This reader creates very simple <em>CAPTCHAs</em> from within a Cocoon
pipeline, enabling quick and safe end-user presence identification. As an
example, look at the following pipeline snippet:</p>

<pre> &lt;map:match pattern="*"&gt;
   &lt;map:read type="captcha" src="{1}"/&gt;

<p>The example will produce an image containing the text in "<tt>{1}</tt>"
"warped" or "bent" in a way similar to the Adobe® Photoshop® "<em>Wave</em>"
filter plugin.</p>

<p>Few pipeline parameters control the operation of the <tt>CaptchaReader</tt>
(this component is not configurable):</p>

<li><tt>width</tt>: the width of the image to generate <em>(default:
<li><tt>height</tt>: the height of the image to generate <em>(default:
<li><tt>foreground</tt>: the text foreground color<em> (default: random)</em>.
<li><tt>background</tt>: the image background color <em>(default:
<li><tt>font</tt>: the font to use for the text <em>(default: serif)</em>.</li>
<li><tt>scale</tt>: the scaling factor for interim images <em>(default:
<li><tt>amount</tt>: the amount of text warping to apply <em>(default:
<li><tt>quality</tt>: the JPEG encoding quality<em> (default: 0.75)</em>.</li>

<p>Note that when the <tt>foreground</tt> parameter is not specified, the
used to write the text will be randomly chosen in a way that it contrasts well
with the background color to avoid problems of illegible text.</p>

<p>Both the <tt>foreground</tt> and <tt>background</tt> parameters
strings in the format specified by
<a href="">Color.decode(String)</a>
(for example <tt>fff</tt>, or <tt>0099CC</tt>) or one of the field
names of the
<a href="">Color</a>
class (for example
<a href="">BLACK</a>
<a href="">cyan</a>

<p>The <tt>scale</tt> parameter controls how much the specified size should
scaled while processing the interim images: the bigger the scaling factor, the
better the image quality, but also the memory used while generating the final
image will be bigger. In other words, use this with care.</p>

<p>The <tt>amount</tt> parameter is interpreted as a floating point number
must be greater than zero. This controls how much text should be warped, and
normally a value of 1 produce quite-good warping. Increasing (or decreasing)
this value will produce more (ore less) warping.</p>

<p>Remember that in no way the <tt>CaptchaReader</tt> claims to be able
generate "unbreakable" text (that will be impossible), and improvements to the
algorithm are welcome.</p>


no changes

no changes

Custom Fields
no changes

no changes

View raw message