Skip to content

Commit

Permalink
textbbox insted of multiline_textbbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Леонтьев Арсений Евгеньевич committed Sep 17, 2022
1 parent e9047d5 commit f1ad884
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion captcha/image.py
Expand Up @@ -172,9 +172,10 @@ def create_captcha_image(self, chars, color, background):
def _draw_character(c):
font = random.choice(self.truefonts)
try:
_, _, w, h = draw.multiline_textbbox((1, 1),c, font=font)
_, _, w, h = draw.textbbox((1, 1), c, font=font)
except AttributeError:
w, h = draw.textsize(c, font=font)

dx = random.randint(0, 4)
dy = random.randint(0, 6)
im = Image.new('RGBA', (w + dx, h + dy))
Expand Down

0 comments on commit f1ad884

Please sign in to comment.