Fix distinction between clean and clean_final lost in API refactor

This commit is contained in:
James R. Barlow
2019-05-23 01:19:58 -07:00
parent 5cecb3ecb4
commit 22298b31be
2 changed files with 15 additions and 6 deletions

View File

@@ -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:

View File

@@ -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'