James R. Barlow
abc2d41e2d
Require recent pikepdf to fix check_pdf_syntax issue
2025-10-29 11:40:51 -07:00
James R. Barlow
6af22051a8
Avoid call to deprecated pdf.check() where possible
2025-08-13 01:15:33 -07:00
James R. Barlow
18b59c57b4
Refactor our tests that check if we are in a container
2024-10-27 11:55:22 -07:00
James R. Barlow
46b49cc176
Suppress missing jbig2dec warning message
...
Windows users can't resolve it easily.
2024-07-22 14:54:40 -07:00
James R. Barlow
6a746a1cbb
ruff linting/Python 3.10 cleanup
2024-02-14 12:41:51 -08:00
James R. Barlow
3b9d4b7f0a
Attempt to deal with oddball mediaboxes
2024-02-11 15:34:54 -08:00
James R. Barlow
4dbc5e1dba
Fix some typing issues
2023-10-24 00:54:31 -07:00
James R. Barlow
16eb5627a7
Fix unused imports and other trivia
2023-10-24 00:54:31 -07:00
James R. Barlow
d4110e78cb
Fix "pikepdf mmap disabled" spam on macOS
2023-10-11 01:24:29 -07:00
James R. Barlow
113a6b45bd
ruff autofixes (mostly typing.* -> collections.abc.*)
2023-10-01 00:02:53 -07:00
James R. Barlow
47b0f28564
Minor documentation and typing fixes
2023-09-25 00:19:48 -07:00
James R. Barlow
d4863cbf0f
helpers: fix typing
2023-09-23 14:59:11 -07:00
James R. Barlow
7b8f081fbf
Enable pikepdf mmap again
2023-09-23 14:50:56 -07:00
James R. Barlow
3e1b3ec98d
Merge branch 'feature/fix-raster-dpi-too-high' into v15
2023-09-21 00:05:56 -07:00
James R. Barlow
e8c82ee4b6
Remove shim for img2pdf < 0.4.4
2023-09-21 00:05:39 -07:00
James R. Barlow
3454c050ed
Introduce Resolution.take_min
2023-09-21 00:01:42 -07:00
James R. Barlow
5902fe45c1
Rename Resolution.mean to to_scalar
2023-09-20 16:58:59 -07:00
James R. Barlow
78981641f0
Introduce new functions to calculate DPI exceptions
2023-09-20 16:58:59 -07:00
James R. Barlow
4924b11b6b
Additional ruff fixes
2023-04-14 01:25:16 -07:00
James R. Barlow
9b8d14d16e
Accept most of ruff's delinting
2023-04-14 00:45:34 -07:00
997380e567
Avoid deleting /dev/null when run as root ( #1068 )
...
Co-authored-by: Andrew Wood <andrew@fluidgravity.co.uk >
2023-01-31 16:20:24 -08:00
James R. Barlow
2ebc36fcec
Merge branch 'feature/drop-3.7'
2022-09-20 22:32:59 -07:00
James R. Barlow
2e55cb5980
helpers: improve typing of Resolution
2022-09-19 20:03:54 -07:00
James R. Barlow
1a0a797ca6
Remove our @deprecated decorator and use standard package
2022-08-04 04:00:25 -07:00
James R. Barlow
80ed2117cc
Change to SPDX license tracking
2022-07-28 01:10:07 -07:00
James R. Barlow
dc6f1a266a
Modernize type annotations
2022-07-23 00:39:24 -07:00
James R. Barlow
b17fb61389
Configure pylint in pyproject and delint
2022-06-12 00:30:44 -07:00
James R. Barlow
72442fa3d0
Fix error messages when run with pikepdf 5.0.0
...
Appears that these are spurious errors from qpdf probing the /DecodeParms
dict on images that don't have it.
Not sure exactly why it happens but this can be safely ignored.
2022-02-18 23:35:44 -08:00
James R. Barlow
2d0ac4707c
Use better img2pdf settings where possible while supporting old versions
...
Fixes #894
2022-01-14 11:55:54 -08:00
James R. Barlow
a63a21a7fc
helpers: remove shim for unsupported old version of pikepdf
2021-10-28 02:46:34 -07:00
James R. Barlow
c725bf79da
flake8 delinting
2021-09-21 16:37:03 -07:00
James R. Barlow
4eca0a165b
pre-commit: pyupgrade modernizing
2021-08-26 18:04:38 -07:00
James R. Barlow
37923ffe52
Work around Pillow 8.3.1 DPI changes
...
Pillow decided against round-tripping DPI values.
https://github.com/python-pillow/Pillow/pull/5476
Fixes #802
2021-07-14 02:34:28 -07:00
James R. Barlow
d673126994
Fix ZeroDivisionError on files containing images drawn at scale 0
...
Fixes #761
2021-04-15 23:26:14 -07:00
James R. Barlow
8f8aaa93ed
Refactor removing log handlers
2021-04-13 13:16:21 -07:00
James R. Barlow
139d9f9841
Shut up pikepdf mmap disabled message
2021-04-08 20:58:46 -07:00
James R. Barlow
9db9a3d6ec
helpers: improve test coverage of Resolution
2021-04-07 23:26:37 -07:00
James R. Barlow
8423bd549b
helpers: don't trap exception on failure to unlink
...
If we can't unlink a file we expect to unlink, logging and moving on is
probably the wrong action.
Coverage never hits this line.
2021-04-07 23:16:10 -07:00
James R. Barlow
a23c22b0e8
helpers: tidy check_pdf
2021-02-25 22:51:53 -08:00
James R. Barlow
ef1e7a814e
Delinting
2021-01-26 01:45:04 -08:00
James R. Barlow
1084724937
docs: improve API docs
2021-01-26 01:40:40 -08:00
James R. Barlow
b4c1f66bc1
typing: tidy up
2020-12-11 14:14:21 -08:00
James R. Barlow
43f41863fa
check_pdf: document how we handle linearization
2020-11-18 11:54:07 -08:00
James R. Barlow
d71e50e83d
Fix "readLinearizationData for file that is not linearized"
...
pikepdf 2.1.0 throws wrong type of exception in this case, so special-case it.
Closes #680
Closes #681
2020-11-18 11:52:17 -08:00
James R. Barlow
b93cf51c0f
Disable pikepdf mmap
...
Infrequently we can reproduce this error:
terminating with uncaught exception of type std::runtime_error: pybind11_object_dealloc(): Tried to deallocate unregistered instance!
The error is probably related to pybind11 issue #2252 and a bunch of
other related issues. Until that is resolved in pybind11 and pikepdf
we will disable the pikepdf mmap interface.
2020-09-16 23:48:55 -07:00
James R. Barlow
aa0ec40102
Change license of all GPLv3 files to MPL-2.0
...
https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-05 00:44:42 -07:00
James R. Barlow
a672422b0b
Enable pikepdf mmap in other contexts
2020-07-22 00:20:07 -07:00
James R. Barlow
62924ee280
Improve API documentation
2020-06-30 04:20:14 -07:00
James R. Barlow
86875997b8
Fix more mypy errors
2020-06-29 02:17:14 -07:00
James R. Barlow
6ac50646f0
Fix OMP_THREAD_LIMIT rounded down to 0 in some cases
2020-06-17 14:43:19 -07:00