Skip to content

lua-captcha is a small lua module to generate CAPTCHA images using lua-gd

License

Notifications You must be signed in to change notification settings

mrDoctorWho/lua-captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

lua-captcha is a small lua module to generate CAPTCHA images using lua-gd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published