mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-05-16 18:45:51 -04:00
Fix JBIG2 not updating progress bar
This commit is contained in:
@@ -8,7 +8,7 @@ from __future__ import annotations
|
||||
import threading
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Iterable
|
||||
from typing import Callable, TypeVar
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
from ocrmypdf._progressbar import NullProgressBar, ProgressBar
|
||||
|
||||
@@ -19,6 +19,10 @@ def _task_noop(*_args, **_kwargs):
|
||||
return
|
||||
|
||||
|
||||
def _task_finished_noop(_result: Any, pbar: ProgressBar):
|
||||
pbar.update()
|
||||
|
||||
|
||||
class Executor(ABC):
|
||||
"""Abstract concurrent executor."""
|
||||
|
||||
@@ -66,7 +70,7 @@ class Executor(ABC):
|
||||
if not worker_initializer:
|
||||
worker_initializer = _task_noop
|
||||
if not task_finished:
|
||||
task_finished = _task_noop
|
||||
task_finished = _task_finished_noop
|
||||
if not task:
|
||||
task = _task_noop
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ def _produce_jbig2_images(
|
||||
options.jbig2_threshold,
|
||||
)
|
||||
|
||||
def jbig2_single_args(root, groups: dict[int, list[XrefExt]]):
|
||||
def jbig2_single_args(root: Path, groups: dict[int, list[XrefExt]]):
|
||||
for group, xref_exts in groups.items():
|
||||
prefix = f'group{group:08d}'
|
||||
# Second loop is to ensure multiple images per page are unpacked
|
||||
|
||||
Reference in New Issue
Block a user