Skip to content

Commit

Permalink
Fix check for OCR file
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Oct 2, 2024
1 parent 77f3a71 commit c3e6213
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion readux_ingest_ecds/services/ocr_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ def add_ocr_to_canvases(manifest):
ocr = get_ocr(canvas)
if isinstance(ocr, etree.XMLSyntaxError):
warnings.append(f"Canvas {canvas.pid} - {ocr.__class__.__name__}: {ocr}")
elif not os.path.exists(canvas.ocr_file_path):
elif canvas.ocr_file_path is not None and not os.path.exists(
canvas.ocr_file_path
):
warnings.append(f"No OCR file for {canvas.pid}.")
elif ocr is not None:
new_ocr_annotations += add_ocr_annotations(canvas, ocr)
Expand Down

0 comments on commit c3e6213

Please sign in to comment.