]> git.ipfire.org Git - ipfire.org.git/commitdiff
users: Fix generating placholder avatars with pillow >= 10
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Aug 2025 13:07:26 +0000 (13:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Aug 2025 13:07:26 +0000 (13:07 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/users.py

index 7bd4714e5bf405c6243aa43ea2f234b76db9b7f8..a1b78dc0f6d0e49a669168974ae8a9418a23f65a 100644 (file)
@@ -126,13 +126,13 @@ class AvatarHandler(base.BaseHandler):
 
                for letter in letters:
                        # Determine size of the printed letter
-                       w, h = font.getsize(letter)
+                       left, top, right, bottom = font.getbbox(letter)
 
                        # Store the maximum height
-                       height = max(h, height)
+                       height = max(bottom, height)
 
                        # Add up the width
-                       width += w
+                       width += right
 
                # Add the margin
                width  = int(width  * 1.75)