fix: 🐛 support pillow < 10
It seems I did this after VLM nodes installed it. This fix handle both cases. closes #155
This commit is contained in:
+7
-1
@@ -333,9 +333,15 @@ class TextToImage:
|
||||
else: # bottom
|
||||
y_text = (height - (line_height_px * len(lines))) - v_offset
|
||||
|
||||
def get_width(line):
|
||||
if hasattr(font, "getsize"):
|
||||
return font.getsize(line)[0]
|
||||
else:
|
||||
return font.getlength(line)
|
||||
|
||||
# Draw each line of text
|
||||
for line in lines:
|
||||
line_width = font.getlength(line)
|
||||
line_width = get_width(line)
|
||||
# Horizontal alignment
|
||||
if h_align == "left":
|
||||
x_text = h_offset
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ imageio_ffmpeg
|
||||
rich
|
||||
rich_argparse
|
||||
matplotlib
|
||||
pillow>=10
|
||||
pillow
|
||||
|
||||
Reference in New Issue
Block a user