Merge pull request #31 from BigBorg/master

randomly add space between characters
This commit is contained in:
Hsiaoming Yang
2018-04-07 10:18:30 +09:00
committed by GitHub

View File

@@ -194,6 +194,8 @@ class ImageCaptcha(_Captcha):
images = []
for c in chars:
if random.random() > 0.5:
images.append(_draw_character(" "))
images.append(_draw_character(c))
text_width = sum([im.size[0] for im in images])