Melib v0.1.11 Melib.Captcha View Source
Link to this section Summary
Link to this section Functions
Link to this function
char_generator(params, chars, x_per_char, index, size) View Source
Link to this function
get_size(size) View Source
Link to this function
random_position(chars, x_per_char, index, height) View Source
Link to this function
random_rgb() View Source
Link to this function
random_rgba() View Source
Link to this function
render(opts \\ []) View Source
生成验证码
控制参数:
size
- 验证码图片大小,默认值:100x40
,宽100,高40font
- 验证码字体名,需要在配置文件中配置字体名和字体文件绝对路径的映射,例如jdjste: "path/to/JDJSTE.TTF"
font_width
- 验证码内容文字加粗,默认值:1bezier_width
- 干扰线加粗, 默认值:2bezier
- 干扰线条数, 默认值:3label
- 验证码内容pointsize
- 字体大小,默认为20noise
- 增加噪点,可选样式:Gaussian
、Impulse
、Laplacian
、Multiplicative
、Poisson
、Uniform
, 默认为Uniform
无噪点