Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -153,7 +153,9 @@ def overlay_text_on_image(img, text, position, text_color=(255, 255, 255), box_c
|
|
153 |
r = font_size - 1
|
154 |
font_size = max(l-1, 1)
|
155 |
|
156 |
-
|
|
|
|
|
157 |
|
158 |
if position == 'top-left':
|
159 |
x, y = 0, 0
|
|
|
153 |
r = font_size - 1
|
154 |
font_size = max(l-1, 1)
|
155 |
|
156 |
+
left, upper, right, lower = draw.textbbox((0, 0), text, font=font)
|
157 |
+
text_width = right - left
|
158 |
+
text_height = lower - upper
|
159 |
|
160 |
if position == 'top-left':
|
161 |
x, y = 0, 0
|