3morrrrr commited on
Commit
3bfa734
·
verified ·
1 Parent(s): 8870779

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -84,7 +84,7 @@ def process_image(image, text):
84
  lines.append(current_line)
85
 
86
  # Draw each line of text within the bounding box
87
- line_height = font.getsize("Hg")[1]
88
  total_text_height = len(lines) * line_height
89
 
90
  if total_text_height > box_height:
 
84
  lines.append(current_line)
85
 
86
  # Draw each line of text within the bounding box
87
+ line_height = text_draw.textbbox((0, 0), "Hg", font=font)[3] - text_draw.textbbox((0, 0), "Hg", font=font)[1]
88
  total_text_height = len(lines) * line_height
89
 
90
  if total_text_height > box_height: