mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-05-06 21:56:21 -04:00
Fix distinction between clean and clean_final lost in API refactor
This commit is contained in:
@@ -92,17 +92,26 @@ def exec_page_sync(page_context):
|
||||
page_context.origin, page_context, correction=orientation_correction
|
||||
)
|
||||
|
||||
preprocess_out = rasterize_out
|
||||
preprocess = rasterize_out
|
||||
if options.remove_background:
|
||||
preprocess_out = preprocess_remove_background(preprocess_out, page_context)
|
||||
preprocess = preprocess_remove_background(preprocess, page_context)
|
||||
|
||||
if options.deskew:
|
||||
preprocess_out = preprocess_deskew(preprocess_out, page_context)
|
||||
preprocess = preprocess_deskew(preprocess, page_context)
|
||||
|
||||
if options.clean:
|
||||
preprocess_out = preprocess_clean(preprocess_out, page_context)
|
||||
cleaned = preprocess_clean(preprocess, page_context)
|
||||
if options.clean_final:
|
||||
preprocess_out = cleaned
|
||||
ocr_image = cleaned
|
||||
else:
|
||||
preprocess_out = preprocess
|
||||
ocr_image = cleaned
|
||||
else:
|
||||
preprocess_out = preprocess
|
||||
ocr_image = preprocess
|
||||
|
||||
ocr_image_out = create_ocr_image(preprocess_out, page_context)
|
||||
ocr_image_out = create_ocr_image(ocr_image, page_context)
|
||||
|
||||
pdf_page_from_image_out = None
|
||||
if not options.lossless_reconstruction:
|
||||
|
||||
@@ -136,7 +136,7 @@ def check_options_sidecar(options):
|
||||
if options.sidecar == '\0':
|
||||
if options.output_file == '-':
|
||||
raise BadArgsError(
|
||||
"--sidecar filename must be specified when output file is " "stdout."
|
||||
"--sidecar filename must be specified when output file is stdout."
|
||||
)
|
||||
options.sidecar = options.output_file + '.txt'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user