From c09a8e8bcc6ac7d2ad6d95c25061f0ab492d0adf Mon Sep 17 00:00:00 2001 From: zyddnys Date: Tue, 28 Nov 2023 14:28:48 -0500 Subject: [PATCH] fix save-text --- manga_translator/manga_translator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manga_translator/manga_translator.py b/manga_translator/manga_translator.py index b81a9d1da..3e79fb9b3 100644 --- a/manga_translator/manga_translator.py +++ b/manga_translator/manga_translator.py @@ -262,7 +262,7 @@ async def _translate_file(self, path: str, dest: str, ctx: Context): img_path = os.path.join(os.path.dirname(dest), img_filename) img.save(img_path, quality=ctx.save_quality) if ctx.text_regions: - self._save_text_to_file(dest, ctx) + self._save_text_to_file(path, ctx) return True return False @@ -628,7 +628,7 @@ def identify_colors(fg_rgb: List[int]): text_output_file = ctx.text_output_file if not text_output_file: - text_output_file = os.path.join(os.path.dirname(image_path), '_translations.txt') + text_output_file = os.path.splitext(image_path)[0] + '_translations.txt' with open(text_output_file, 'a', encoding='utf-8') as f: f.write(s)