From f1ad88403fd892836dba93d829871fd40635a063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D1=82=D1=8C=D0=B5=D0=B2=20=D0=90?= =?UTF-8?q?=D1=80=D1=81=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=95=D0=B2=D0=B3=D0=B5?= =?UTF-8?q?=D0=BD=D1=8C=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sat, 17 Sep 2022 17:36:03 +0400 Subject: [PATCH] textbbox insted of multiline_textbbox --- captcha/image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/captcha/image.py b/captcha/image.py index fd2620c..4c5a4de 100644 --- a/captcha/image.py +++ b/captcha/image.py @@ -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))