mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-11 17:00:49 +00:00
captca.py: Fix PIL 10 support again
Bug: T354099 Follows-Up: Ia17157d45995b78c6a73f844dfe7d20d09564748 Change-Id: I9d1fe7ad7f12fd79c960574daf79e558d88cb02c
This commit is contained in:
parent
db932b2ae2
commit
bdd127a276
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue