randomly add space between characters

This commit is contained in:
borg
2018-03-23 11:20:07 +08:00
parent ece8aa219e
commit 97a8696472

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])