CaptchaReader
Summary
The CaptchaReader is a simple tool generating JPEG images for the text supplied as its source in a way so that it's hard to parse automatically.
Basic information
Component type | Reader |
---|---|
Cocoon block | captcha |
Java class | org.apache.cocoon.reading.CaptchaReader |
Name in Sitemap | |
Cacheable | No |
Documentation
The CaptchaReader 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.
CAPTCHA means quite literally Completely Automated Public Turing Test to Tell Computers and Humans Apart and one of the best resources on this can be found at the Carnegie Mellon School of Computer Science CAPTCHA project..
This reader creates very simple CAPTCHAs from within a Cocoon pipeline, enabling quick and safe end-user presence identification. As an example, look at the following pipeline snippet:
<map:match pattern="*"> <map:read type="captcha" src="{1}"/> </map:match>
The example will produce an image containing the text in "{1}" "warped" or "bent" in a way similar to the Adobe® Photoshop® "Wave" filter plugin.
Few pipeline parameters control the operation of the CaptchaReader (this component is not configurable):
- width: the width of the image to generate (default: 100).
- height: the height of the image to generate (default: 50).
- foreground: the text foreground color (default: random).
- background: the image background color (default: white).
- font: the font to use for the text (default: serif).
- scale: the scaling factor for interim images (default: 5).
- amount: the amount of text warping to apply (default: 1).
- quality: the JPEG encoding quality (default: 0.75).