Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-077
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2020-077
2020-077
Commits
0938eed7
Commit
0938eed7
authored
Jan 09, 2021
by
Manoj Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct repeated GIF
parent
3ea53fd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
api.py
api.py
+3
-2
reveng/gifMaker.py
reveng/gifMaker.py
+6
-3
No files found.
api.py
View file @
0938eed7
...
...
@@ -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
:
...
...
reveng/gifMaker.py
View file @
0938eed7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment