Spaces:
Running
Running
add libreoffice
Browse files
app.py
CHANGED
@@ -147,15 +147,15 @@ ppt.save("output.pptx")
|
|
147 |
subprocess.run(["python", code_file], capture_output=True, text=True, check=True)
|
148 |
|
149 |
# Convert the pptx to jpg for preview
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
|
160 |
return "Default slide generated after 3 attempts failed.", pptx_path
|
161 |
|
|
|
147 |
subprocess.run(["python", code_file], capture_output=True, text=True, check=True)
|
148 |
|
149 |
# Convert the pptx to jpg for preview
|
150 |
+
preview_image = "image_previews/output.jpg"
|
151 |
+
command = [
|
152 |
+
"libreoffice",
|
153 |
+
"--headless",
|
154 |
+
"--convert-to", "jpg",
|
155 |
+
"--outdir", "image_previews",
|
156 |
+
pptx_path
|
157 |
+
]
|
158 |
+
subprocess.run(command)
|
159 |
|
160 |
return "Default slide generated after 3 attempts failed.", pptx_path
|
161 |
|
apt.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
libreoffice
|