Merge "captca.py: Fix PIL 10 support again"

This commit is contained in:
jenkins-bot 2024-01-29 19:36:50 +00:00 committed by Gerrit Code Review
commit ebb8f73ae3

View file

@ -115,7 +115,12 @@ def gen_captcha(text, fontname, fontsize, file_name):
font=font,
fill=fgcolor,
)
offset += font.getsize(c)[0] - random.uniform(5, 6)
if IMAGEFONT_HAS_GETBBOX:
offset += font.getbbox(c)[2:][0]
else:
offset += font.getsize(c)[0]
offset -= random.uniform(5, 6)
for i in range(10):
d.arc(