Animate_SVG_v2 / app.py
Daniel Gil-U Fuhge
updated recursion limit
62fc38e
raw
history blame
705 Bytes
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))