Commit 0938eed7 authored by Manoj Kumar's avatar Manoj Kumar

correct repeated GIF

parent 3ea53fd0
......@@ -52,7 +52,7 @@ def about():
@app.route('/tts/get/<msg>', methods=['GET', 'POST'])
def response(msg):
# clearoutputfolder()
clearoutputfolder()
# message = request.get_json()
# responseGIF = processInput(message['message'])
print(msg)
......@@ -61,13 +61,14 @@ def response(msg):
# response = {
# "gifPath": responseGIF
# }
clearoutputfolder()
return responseGIF
# return send_file(responseGIF, mimetype='image/gif')
# clear the OUTPUT folder after displaying the GIF image
def clearoutputfolder():
folder = os.path.join(os.path.dirname(__file__), 'reveng\output')
folder = os.path.join(os.path.dirname(__file__), 'static\output')
for filename in os.listdir(folder):
file_path = os.path.join(folder, filename)
try:
......
......@@ -21,8 +21,7 @@ from reveng.firebaseConfig import getStorageInstance, getStorageBucket
PATH = os.path.dirname(os.path.abspath(__file__))
gifName = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=15))
STATIC_PATH = os.getcwd() + "\\static"
Blob.generate_signed_url
......@@ -36,7 +35,10 @@ def generateGIF(images):
# @return the generated GIF path
###
gifName = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=15))
blob = ''
gifPath = ''
blob = bucket.blob(gifName + ".gif")
gifPath = STATIC_PATH + "\\output\\" + gifName + ".gif"
imageio.mimwrite(gifPath, images, duration=0.5)
......@@ -53,6 +55,7 @@ def generateGIF(images):
}
print(blob.public_url)
return response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment