Fixed python compatibility

This commit is contained in:
Luca Sorace "Stranck 2024-02-09 18:04:50 +01:00
parent 5d851acbeb
commit 951e4c0015
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ def draw_profile (source, member, position, font, size=(170, 170), border_width=
# Draw border
idraw.rounded_rectangle(border_loc, border_width, border_color)
# Draw profile picture
with Image.open(f'res/propic/{member['propic'] or 'default.png'}') as to_add:
fileName = member['propic'] or 'default.png'
with Image.open(f'res/propic/{fileName}') as to_add:
source.paste(to_add.resize (size), profile_location)
name_len = idraw.textlength(str(member['name']), font)
calc_size = 0