Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ strict_bytes = false
module = [
"click_man.*",
"djvu.*",
"ocrmypdf.*",
#"ocrmypdf.*",
"pdfrw.*",
"uv_build.*",
]
Expand Down
4 changes: 3 additions & 1 deletion src/dpsprep/ocrmypdf_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def run_ocrmypdf_optimizer(options: DpsPrepOptions) -> bool:
jobs=options.pool_size,
optimize=options.optlevel,
# When set to 0, OCRmyPDF's "optimize" function attempts to adjust them
jpg_quality=quality or 0,
png_quality=quality or 0,
)

# Set jpg_quality via attribute (backwards-compatible setter) rather than constructor kwarg, since the kwarg differs across OMP versions.
omp_options.jpg_quality = quality or 0

info = PdfInfo(workdir.combined_pdf_path)
context = PdfContext(omp_options, workdir.ocrmypdf_tmp_path, workdir.combined_pdf_path, info, None)

Expand Down
Loading