James R. Barlow and aider
9535b52d06
fix: revert default option values to preserve original behavior
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: set default optimize value to 1 to prevent NoneType comparison
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
e1216eddb0
test: modify test_two_languages to use list of languages
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
21d69ffe87
fix: set default value for fast_web_view to prevent NoneType errors
...
This change ensures that `fast_web_view` always has a default value of 1.0, preventing the TypeError that was occurring in multiple test cases when trying to multiply `None` with an integer.
The modifications include:
1. Changing the type hint for `fast_web_view` from `float | None` to `float`
2. Setting a default value of 1.0
3. Adding a validation step in the `model_validator` to set the default value if not provided
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3baeb83533
fix: Add compatibility for jpeg_quality and resolve strategy validation
...
This commit addresses several test failures by:
- Adding a compatibility property for `jpeg_quality`
- Changing default color conversion strategy from 'auto' to 'RGB'
- Ensuring `tesseract_config` is always a list
- Improving validation for color conversion and image compression strategies
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
134f4fcc28
fix: remove Union type hints and add default values in OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
a869a4ac42
fix: filter out None values from OCROptions kwargs
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
48a2fdb0f2
refactor: replace _kwargs_to_cmdline with direct OCROptions construction in experimental API functions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
91a2d39845
refactor: replace command line synthesis with direct OCROptions construction
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3a0a7c546b
feat: Implement JSON serialization for OCROptions with safe handling of Path and stream objects
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
d0a46a0359
feat: convert CLI Namespace to OCROptions in main entry point
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
cb22a35834
refactor: convert hOCR API entry points to use OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
9ff7ab491c
fix: handle None jobs in hOCR pipeline concurrency
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
refactor: remove unused argparse import from pdf_to_hocr.py
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: import OCROptions in pdf_to_hocr pipeline
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: handle None jobs in hocr_to_ocr_pdf pipeline
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
0c3110857e
fix: add lossless_reconstruction to namespace options in PdfContext
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
aad90bcb54
fix: compute lossless_reconstruction when not present in options
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
5f685aef6e
fix: handle None jobs in concurrent processing
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
65b89cafde
fix: use available_cpu_count fallback for jobs in hOCR
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
eeda99636a
fix: handle Namespace conversion in PdfContext initialization
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
afc85333ac
feat: add OCROptions import and type hints to pipeline functions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3987a610e1
fix: update pipeline setup to handle immutable OCROptions correctly
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
dab969f97d
refactor: update context management with OCROptions type hints
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow
480a8253eb
refactor: propagate lossless_reconstruction option to clean_options in PageContext
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
8a06dd478a
refactor: update pipeline functions to use OCROptions instead of argparse.Namespace
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
4dbd34f06a
refactor: update type hint for do_get_pdfinfo to accept generic options
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
8668cf4524
fix: add type conversion for pages in pipeline common
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
1d74c2831f
refactor: update pipeline entry points to use OCROptions directly
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:46 -08:00
James R. Barlow and aider
530186b468
docs: update documentation for OCROptions plugin interface migration
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:46 -08:00
James R. Barlow and aider
7b37f57b1c
refactor: replace Namespace with OCROptions in plugins and validation
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:46 -08:00
James R. Barlow
d4b7165d72
fix: resolve pickling issue with Pydantic validators in PageContext
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
Fix pickling issue
2025-12-21 12:21:46 -08:00
James R. Barlow and aider
f5bfd2fd3e
Add compat function for pages_from_ranges
...
fix: handle Pydantic validation errors with correct exit code
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:46 -08:00
James R. Barlow and aider
7575dddefc
fix: add lossless_reconstruction attribute to OCROptions for compatibility
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: resolve recursion error in lossless_reconstruction option
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: ensure lossless_reconstruction attribute is added to Namespace
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: ensure lossless_reconstruction attribute is correctly propagated to PageContext
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:49 -08:00
James R. Barlow and aider
66a3e8508e
feat: add comprehensive validators to OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:23 -08:00
James R. Barlow and aider
7bb3a97208
refactor: update test_validation.py to use Pydantic model validation
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:23 -08:00
James R. Barlow and aider
d2add01217
fix: remove deprecated set_lossless_reconstruction import and call
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:23 -08:00
James R. Barlow and aider
4476e81240
refactor: remove redundant validation functions from _validation.py
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:23 -08:00
James R. Barlow and aider
a373fcd649
fix: add jobs fallback in pipeline common
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:42:23 -08:00
James R. Barlow
87478bc240
Fix options.jpg_quality issue
2025-12-13 11:42:23 -08:00
James R. Barlow and aider
04ad78f01d
refactor: replace OptimizeOptions with OCROptions in tests
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:58 -08:00
James R. Barlow and aider
62c3ae80c7
fix: ensure pickling compatibility for OCROptions in multiprocessing
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:58 -08:00
James R. Barlow
d556014185
Remove language warning
2025-12-13 11:41:58 -08:00
James R. Barlow and aider
d18efcbbf1
fix: support flexible type inputs for pages and unpaper_args
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:27 -08:00
James R. Barlow and aider
f9a4a2e240
fix: handle missing input_file in OCROptions namespace conversion
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:27 -08:00
James R. Barlow and aider
5f89100dc3
test: add lossless_reconstruction field to OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:27 -08:00
James R. Barlow and aider
1ef9aaf659
fix: Correct PDF/A part extraction and handle hOCR API output file
...
This commit addresses two issues:
1. Properly extract the PDF/A part from output_type
2. Add a placeholder output_file for hOCR API tests when output_folder is used
The changes include:
- Modifying `from_namespace` to add a placeholder output_file
- Updating PDF/A part extraction logic to handle different output_type formats
- Ensuring correct PDF/A part is passed to Ghostscript
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:27 -08:00
James R. Barlow and aider
4c4a1cfa17
fix: Resolve API test failures with pdf_renderer and output_file handling
...
This commit addresses several issues in the OCRmyPDF API:
- Fixed handling of 'auto' pdf_renderer by defaulting to 'hocr'
- Added placeholder for output_file when output_folder is present
- Updated model_fields access to use class method instead of instance attribute
- Improved error handling and default behavior in PDF rendering
Specifically:
- Modified `_options.py` to handle 'auto' pdf_renderer
- Updated attribute access to use class methods
- Added placeholder for output_file in special cases
- Updated `_pipelines/ocr.py` to handle 'auto' pdf_renderer
These changes resolve the test failures in `test_api.py` and improve the library's flexibility.
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:41:27 -08:00
James R. Barlow and aider
5251e21f7e
refactor: migrate OCROptions validators to Pydantic V2
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:40:57 -08:00
James R. Barlow and aider
28eb923d9f
feat: rename _extra_attrs to extra_attrs in OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:40:57 -08:00
James R. Barlow and aider
1579337ebe
refactor: Create OCROptions model with Namespace compatibility
...
This commit introduces a new `OCROptions` class in `_options.py` that provides:
- Proper typing for OCRmyPDF options
- Pydantic validation
- Backward compatibility with `argparse.Namespace`
- Gradual migration support for the options system
Key changes:
- Added comprehensive option fields with type hints
- Implemented custom attribute access methods
- Created conversion methods between Namespace and OCROptions
- Updated type hints in multiple files to support both types
- Maintained existing validation logic
The new model allows for a step-by-step refactoring of the options handling throughout the project.
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-13 11:40:57 -08:00
rugk and GitHub
8d715c4157
docs: fix and clarify podman usage instructions ( #1601 )
...
* docs: fix and clarify podman usage instructions
* the full reference `jbarlow83/ocrmypdf-alpine` as in the other commands may fix an issue if you do not have `ocrmypdf` already downloaded locally
* also clarified the command at the end for usage when SELinux is enabled
* docs: clarify difference between SeLinux and rootless user mapping
2025-12-01 13:07:09 -08:00
Chris Mayo and GitHub
9dbce33ee6
Update Changelog URL ( #1597 )
...
Renamed in:
d1a45e4a ("Convert remaining rst -> md", 2025-04-17)
2025-11-16 23:10:48 -08:00
James R. Barlow
54ce09496c
v16.12.0 release notes
v16.12.0
2025-11-11 13:48:06 -08:00