File size: 705 Bytes
2f22ac0
d228bd9
62fc38e
347fa2e
2f22ac0
d228bd9
 
 
 
 
d019106
 
d228bd9
 
 
217b3d5
62fc38e
347fa2e
310c2df
d228bd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import streamlit as st
import os
import sys
from animationPipeline import animateLogo


uploaded_file = st.file_uploader('Please upload your SVG')
if uploaded_file is not None:
    file_details = {"FileName":uploaded_file.name,"FileType":uploaded_file.type}
    st.write(file_details)
    if not os.path.exists('tempDir'):
       os.mkdir('tempDir')
    with open(os.path.join("tempDir",uploaded_file.name),"wb") as f: 
      f.write(uploaded_file.getbuffer())         
    st.success("Saved File")
    path = os.path.join('tempDir', uploaded_file.name)
    sys.setrecursionlimit(1500)
    animateLogo(path)
    st.download_button('Download animated SVG', os.path.join('tempDir', uploaded_file.name))