Spaces:
Paused
Paused
Daniel Gil-U Fuhge commited on
Commit ·
0000d05
1
Parent(s): bc86db8
update download
Browse files
app.py
CHANGED
|
@@ -7,14 +7,18 @@ from animationPipeline import animateLogo
|
|
| 7 |
uploaded_file = st.file_uploader('Please upload your SVG')
|
| 8 |
if uploaded_file is not None:
|
| 9 |
file_details = {"FileName":uploaded_file.name,"FileType":uploaded_file.type}
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
|
|
|
| 7 |
uploaded_file = st.file_uploader('Please upload your SVG')
|
| 8 |
if uploaded_file is not None:
|
| 9 |
file_details = {"FileName":uploaded_file.name,"FileType":uploaded_file.type}
|
| 10 |
+
if uploaded_file.type is not 'svg':
|
| 11 |
+
st.write('Please upload an SVG file.')
|
| 12 |
+
else:
|
| 13 |
+
st.write(file_details)
|
| 14 |
+
if not os.path.exists('tempDir'):
|
| 15 |
+
os.mkdir('tempDir')
|
| 16 |
+
path = os.path.join('tempDir', uploaded_file.name)
|
| 17 |
+
with open(path,"wb") as f:
|
| 18 |
+
f.write(uploaded_file.getbuffer())
|
| 19 |
+
st.success("Saved File")
|
| 20 |
+
sys.setrecursionlimit(1500)
|
| 21 |
+
animateLogo(path)
|
| 22 |
+
with open(path, "rb") as file:
|
| 23 |
+
st.download_button('Download animated SVG', filename=uploaded_file.name+"_animated.svg")
|
| 24 |
|