Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,13 @@ def text_to_video(text, voice, rate, pitch, video_width, video_height, bg_color,
|
|
81 |
lines = page.split("\n")
|
82 |
for j, line in enumerate(lines):
|
83 |
draw.text(int(video_width / 2), (j + 1) * (text_size + 10), line)
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
img.format = 'png'
|
86 |
img_path = os.path.join(tempfile.gettempdir(), f"page_{i}.png")
|
87 |
img.save(filename=img_path)
|
|
|
81 |
lines = page.split("\n")
|
82 |
for j, line in enumerate(lines):
|
83 |
draw.text(int(video_width / 2), (j + 1) * (text_size + 10), line)
|
84 |
+
|
85 |
+
from PIL import ImageDraw
|
86 |
+
|
87 |
+
# Assuming 'img' is an instance of a PIL Image object
|
88 |
+
draw = ImageDraw.Draw(img) # Create a drawing object
|
89 |
+
# Now you can use 'draw' to draw on 'img'
|
90 |
+
|
91 |
img.format = 'png'
|
92 |
img_path = os.path.join(tempfile.gettempdir(), f"page_{i}.png")
|
93 |
img.save(filename=img_path)
|