Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.27 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.27 KB

lua-captcha

What

Lua-captcha is a simple lua library that allows you to generate captcha images. It uses lua-gd library to create images.

This repository contains several fixes and a few new features, such as an easy way to get the generated image data.

Note: Lua-captcha is based on the lua-captcha project by startx.

Dependencies

  • libgd — GD Graphics library
  • lua-gd — Lua bindings to libgd

Installation

All you need is to run:

make install

And have fun!

Usage

Usage is quite simple.

The following code is used to write the generated captcha to a file named "captcha1.jpg":

local captcha = require 'captcha'
local filename = "captcha1.jpg"
-- Create the captcha object
local cap = captcha.new()
-- Set font (required)
cap:font("./Vera.ttf")
cap:write(filename, 70)
print("Captcha text " .. cap:getStr() .. "\n")

Look the examples folder for more examples.

Copyright

© 2011 startx [email protected]

© 2014-2015 mrDoctorWho [email protected]

License

The MIT License.