From c101755d774a37c610feb0f80fe648166840cdfb Mon Sep 17 00:00:00 2001 From: zyddnys Date: Fri, 17 May 2024 10:12:14 -0400 Subject: [PATCH] fix #624 --- manga_translator/server/web_main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/manga_translator/server/web_main.py b/manga_translator/server/web_main.py index 858bd2b1d..5130af30e 100644 --- a/manga_translator/server/web_main.py +++ b/manga_translator/server/web_main.py @@ -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] = { @@ -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', @@ -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