Skip to content

Commit ecce607

Browse files
committed
Fix Pillow deprecation error
1 parent 63af7fa commit ecce607

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pictures/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def placeholder(width: int, height: int, alt):
9494
raise RuntimeError(f"Unsupported platform: {sys.platform}")
9595
font = ImageFont.truetype(font_name, fontsize)
9696
text = unquote(f"{alt}\n<{width}x{height}>")
97-
while font.getsize(text)[0] < width / 2:
97+
while font.getlength(text) < width / 2:
9898
# iterate until the text size is just larger than the criteria
9999
fontsize += 1
100100
font = ImageFont.truetype(font_name, fontsize)

0 commit comments

Comments
 (0)