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
James R. Barlow
698aab4f75
Add a lot of type annotations
2020-06-15 15:20:50 -07:00
James R. Barlow
a87c81a64f
helpers: remove unnecessary isinstance test
2020-05-12 01:28:50 -07:00
James R. Barlow
fe4296c53b
safe_symlink: remove deprecated params
2020-05-03 00:53:47 -07:00
James R. Barlow
c85278b31d
Delinting
2020-05-03 00:53:29 -07:00
James R. Barlow
d8ff4485f8
Move samefile to helpers
2020-05-01 02:18:11 -07:00
James R. Barlow
8f5c95f0f4
Remove last vestiges of command line usage of qpdf - change to check_pdf
2020-04-26 05:33:26 -07:00
James R. Barlow
94c52a6fa3
Refactor 'xyres' into Resolution
2020-04-24 04:12:05 -07:00
James R. Barlow
af91489376
Remove safe_symlink log= warning
2020-04-14 23:59:33 -07:00
James R. Barlow
58ec56180a
Add a few more type annotations to public APIs
2020-04-10 13:00:19 -07:00
James R. Barlow
b0e92760a2
tests: add coverage for helpers
2019-12-30 15:52:10 -08:00
James R. Barlow
72d3ee3a87
Refactor symlink usage to support Windows
2019-12-04 17:13:51 -08:00
James R. Barlow
1beb7dfd37
helpers: don't expect psutil will be installed
...
It's not in stdlib
2019-06-22 02:36:06 -07:00
James R. Barlow
8b8de7cc1d
Add new --pages feature to limit OCR to only specific pages
2019-06-12 17:27:47 -07:00
James R. Barlow
61afef549e
Remove some now-unused code; etc
2019-05-17 14:25:17 -07:00
James R. Barlow
56067b590b
Make re_symlink() not require a log object
2019-05-17 01:59:36 -07:00
James R. Barlow
0880b16491
Sort imports with isort
2018-12-30 01:28:15 -08:00
James R. Barlow
06308a22ce
Reformat with black
2018-12-30 01:27:49 -08:00
James R. Barlow
72b920eb16
Drop support for Python 3.5
2018-12-30 00:23:26 -08:00