From dde670d9236e1b52cff66f4ff57b04c38f892491 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 25 Feb 2026 14:32:50 -0600 Subject: [PATCH] Fixup --- run/ocr/ocr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run/ocr/ocr.py b/run/ocr/ocr.py index 61a69ba..b1a2a32 100644 --- a/run/ocr/ocr.py +++ b/run/ocr/ocr.py @@ -25,7 +25,7 @@ def ocr_directory(input_dir): # Check if the file is an image if file_name.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif')): input_path = os.path.join(root, file_name) - output_path = os.path.join(root, file_name.replace('.', '_ocr.')) + output_path = f'{input_path}.ocr.json' text = None if os.path.exists(output_path): @@ -35,7 +35,7 @@ def ocr_directory(input_dir): text = ocr_image(ocr, input_path) if text: # Write the OCR result to a JSON file - json_output_path = output_path.rsplit('.', 1)[0] + '.json' + json_output_path = output_path.rsplit('.', 1)[0] with open(json_output_path, 'w') as f: f.write(f'{{"text": "{text}"}}') -- 2.47.3