Melib v0.1.12 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

random_position(chars, x_per_char, index, height) View Source

生成验证码

控制参数:

  • size - 验证码图片大小,默认值:100x40,宽100,高40
  • font - 验证码字体名,需要在配置文件中配置字体名和字体文件绝对路径的映射,例如jdjste: "path/to/JDJSTE.TTF"
  • font_width - 验证码内容文字加粗,默认值:1
  • bezier_width - 干扰线加粗, 默认值:2
  • bezier - 干扰线条数, 默认值:3
  • label - 验证码内容
  • point_size - 字体大小,默认为20
  • noise - 增加噪点,可选样式: GaussianImpulseLaplacianMultiplicativePoissonUniform, 默认为Uniform无噪点