Skip to content

Commit

Permalink
fix: adapt the code for Pillow 10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Sep 6, 2023
1 parent 9f3b426 commit 45f6b6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mailadm/gen_qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def gen_qr(config, token_info):
qr_final_size = width - (qr_padding * 2)

# draw text
info_pos = (width - font.getsize(info.strip())[0]) // 2
font_left, _font_top, font_right, _font_bottom = font.getbbox(info.strip())
font_width = font_right - font_left
info_pos = (width - font_width) // 2
draw.multiline_text(
(info_pos, size - qr_padding // 2),
info,
Expand Down

0 comments on commit 45f6b6f

Please sign in to comment.