Skip to content

Commit

Permalink
fix #624
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed May 17, 2024
1 parent 98aa019 commit c101755
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions manga_translator/server/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def run_async(request):
# return web.json_response({'state': 'error'})
else:
os.makedirs(f'result/{task_id}/', exist_ok=True)
img.save(f'result/{task_id}/input.jpg')
img.save(f'result/{task_id}/input.png')
QUEUE.append(task_id)
now = time.time()
TASK_DATA[task_id] = {
Expand Down Expand Up @@ -437,8 +437,7 @@ async def submit_async(request):
}
elif task_id not in TASK_DATA or task_id not in TASK_STATES:
os.makedirs(f'result/{task_id}/', exist_ok=True)
img = img.convert('RGB')
img.save(f'result/{task_id}/input.jpg')
img.save(f'result/{task_id}/input.png')
QUEUE.append(task_id)
TASK_STATES[task_id] = {
'info': 'pending',
Expand All @@ -465,8 +464,7 @@ async def manual_translate_async(request):
task_id = secrets.token_hex(16)
print(f'New `manual-translate` task {task_id}')
os.makedirs(f'result/{task_id}/', exist_ok=True)
img = img.convert('RGB')
img.save(f'result/{task_id}/input.jpg')
img.save(f'result/{task_id}/input.png')
now = time.time()
QUEUE.append(task_id)
# TODO: Add form fields to manual translate website
Expand Down

0 comments on commit c101755

Please sign in to comment.