Display page numbers in log messages when grafting
This commit is contained in:
@@ -130,7 +130,7 @@ class OcrGrafter:
|
|||||||
text_rotation = autorotate_correction
|
text_rotation = autorotate_correction
|
||||||
text_misaligned = (text_rotation - content_rotation) % 360
|
text_misaligned = (text_rotation - content_rotation) % 360
|
||||||
log.debug(
|
log.debug(
|
||||||
f"Rotations for page {pageno}: [text, auto, misalign, content] = "
|
f"Rotations for page: [text, auto, misalign, content] = "
|
||||||
f"{text_rotation}, {autorotate_correction}, "
|
f"{text_rotation}, {autorotate_correction}, "
|
||||||
f"{text_misaligned}, {content_rotation}"
|
f"{text_misaligned}, {content_rotation}"
|
||||||
)
|
)
|
||||||
|
|||||||
+13
-9
@@ -252,15 +252,19 @@ def exec_concurrent(context: PdfContext):
|
|||||||
ocrgraft = OcrGrafter(context)
|
ocrgraft = OcrGrafter(context)
|
||||||
|
|
||||||
def update_page(result: PageResult, pbar):
|
def update_page(result: PageResult, pbar):
|
||||||
sidecars[result.pageno] = result.text
|
try:
|
||||||
pbar.update()
|
tls.pageno = result.pageno + 1
|
||||||
ocrgraft.graft_page(
|
sidecars[result.pageno] = result.text
|
||||||
pageno=result.pageno,
|
pbar.update()
|
||||||
image=result.pdf_page_from_image,
|
ocrgraft.graft_page(
|
||||||
textpdf=result.ocr,
|
pageno=result.pageno,
|
||||||
autorotate_correction=result.orientation_correction,
|
image=result.pdf_page_from_image,
|
||||||
)
|
textpdf=result.ocr,
|
||||||
pbar.update()
|
autorotate_correction=result.orientation_correction,
|
||||||
|
)
|
||||||
|
pbar.update()
|
||||||
|
finally:
|
||||||
|
tls.pageno = None
|
||||||
|
|
||||||
exec_progress_pool(
|
exec_progress_pool(
|
||||||
use_threads=context.options.use_threads,
|
use_threads=context.options.use_threads,
|
||||||
|
|||||||
Reference in New Issue
Block a user