Update app.py
Browse files
app.py
CHANGED
|
@@ -143,7 +143,7 @@ def generate_professional_content(main_title, workout_names, image_files):
|
|
| 143 |
|
| 144 |
clean_name = clean_text(workout_name, 50)
|
| 145 |
pdf.set_font('Arial', 'B', 16)
|
| 146 |
-
pdf.
|
| 147 |
|
| 148 |
pdf.ln(5)
|
| 149 |
pdf.set_font('Arial', 'B', 14)
|
|
@@ -200,6 +200,7 @@ def generate_professional_content(main_title, workout_names, image_files):
|
|
| 200 |
pdf_path = f"professional_workout_{timestamp}.pdf"
|
| 201 |
pdf.output(pdf_path)
|
| 202 |
|
|
|
|
| 203 |
video_path = None
|
| 204 |
if VIDEO_ENABLED and hd_templates:
|
| 205 |
try:
|
|
@@ -241,6 +242,7 @@ def generate_professional_content(main_title, workout_names, image_files):
|
|
| 241 |
print(f"Video error: {e}")
|
| 242 |
video_path = None
|
| 243 |
|
|
|
|
| 244 |
for path in hd_templates:
|
| 245 |
try:
|
| 246 |
os.remove(path)
|
|
@@ -303,7 +305,7 @@ with gr.Blocks(
|
|
| 303 |
elem_classes="input-box"
|
| 304 |
)
|
| 305 |
with gr.Column(scale=1):
|
| 306 |
-
images_input = gr.File(
|
| 307 |
label="📸 Workout Images *",
|
| 308 |
file_count="multiple",
|
| 309 |
file_types=["image"],
|
|
|
|
| 143 |
|
| 144 |
clean_name = clean_text(workout_name, 50)
|
| 145 |
pdf.set_font('Arial', 'B', 16)
|
| 146 |
+
pdf.cell(0, 14, clean_name.upper(), ln=1, align='C')
|
| 147 |
|
| 148 |
pdf.ln(5)
|
| 149 |
pdf.set_font('Arial', 'B', 14)
|
|
|
|
| 200 |
pdf_path = f"professional_workout_{timestamp}.pdf"
|
| 201 |
pdf.output(pdf_path)
|
| 202 |
|
| 203 |
+
# HD VIDEO GENERATION
|
| 204 |
video_path = None
|
| 205 |
if VIDEO_ENABLED and hd_templates:
|
| 206 |
try:
|
|
|
|
| 242 |
print(f"Video error: {e}")
|
| 243 |
video_path = None
|
| 244 |
|
| 245 |
+
# Cleanup
|
| 246 |
for path in hd_templates:
|
| 247 |
try:
|
| 248 |
os.remove(path)
|
|
|
|
| 305 |
elem_classes="input-box"
|
| 306 |
)
|
| 307 |
with gr.Column(scale=1):
|
| 308 |
+
images_input = gr.File(
|
| 309 |
label="📸 Workout Images *",
|
| 310 |
file_count="multiple",
|
| 311 |
file_types=["image"],
|