Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

from imageProcessEngine import imageProcess

from datetime import datetime

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = "../gcp-auth.json"


Expand All @@ -34,7 +36,19 @@ def main():

@app.post("/generateApp")
async def main(file: UploadFile):
src = os.path.abspath("../results/source.png")

now = datetime.now()
time_stamp = now.strftime("%H:%M:%S")
path = "../results/"
extension = "source.png"

path += time_stamp
path += "/"
os.mkdir(path)
path += extension
src = os.path.abspath(path)

# src = os.path.abspath("../results/source.png")
with open(src, "wb") as buffer:
shutil.copyfileobj(file.file, buffer)
# data = await file.read()
Expand Down