mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-05-06 13:47:41 -04:00
Add safety check to prevent merge from running when not sensible
This commit is contained in:
@@ -247,6 +247,10 @@ if options.clean and not options.clean_final \
|
||||
"Tesseract PDF renderer cannot render --clean pages without "
|
||||
"also performing --clean-final, so --clean-final is assumed.")
|
||||
|
||||
lossless_reconstruction = False
|
||||
if options.pdf_renderer == 'hocr':
|
||||
if not options.deskew and not options.clean_final:
|
||||
lossless_reconstruction = True
|
||||
|
||||
# ----------
|
||||
# Logging
|
||||
@@ -613,6 +617,7 @@ def render_hocr_debug_page(
|
||||
|
||||
|
||||
@active_if(options.pdf_renderer == 'hocr')
|
||||
@active_if(lossless_reconstruction)
|
||||
@collate(
|
||||
input=[render_hocr_page, split_pages],
|
||||
filter=regex(r".*/(\d{6})(?:\.hocr\.pdf|\.ocr\.page\.pdf)"),
|
||||
|
||||
Reference in New Issue
Block a user