James R. Barlow
9b8d14d16e
Accept most of ruff's delinting
2023-04-14 00:45:34 -07:00
James R. Barlow
b7eb93eb79
Adopt ruff and fix prelim lints
2023-04-14 00:19:17 -07:00
James R. Barlow
1709e23701
pipeline: add further typing details
2022-09-19 20:19:15 -07:00
James R. Barlow
a1c7826336
dep5: mention mawi
2022-08-06 15:47:45 -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
9c8ddd853d
Typing adjustments
2022-07-23 00:07:50 -07:00
James R. Barlow
adf97fd82c
pipeline: eliminate useless test
2022-07-07 02:08:14 -07:00
James R. Barlow
17a5b8b43c
Refactor reporting of optimization failures
2022-06-13 01:30:15 -07:00
James R. Barlow
13d11e76e5
optimize plugin: solve linearization and "is optimization enabled?" issues
2022-06-13 00:59:41 -07:00
James R. Barlow
61069660a2
Move optimization options to plugin
2022-06-12 02:42:16 -07:00
James R. Barlow
685a06c93d
Move optimize into a builtin plugin
2022-06-12 02:23:13 -07:00
James R. Barlow
b17fb61389
Configure pylint in pyproject and delint
2022-06-12 00:30:44 -07:00
James Barlow
776ada6713
Upgrade pre-commit and associated tools; various lints
2022-04-03 20:53:01 -07:00
James Barlow
f29fe7f23e
Fix Pillow deprecation warnings
2022-04-03 13:30:50 -07: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
ea69e868ed
unpaper: issue warning if image too large to clean
2022-01-11 10:44:38 -08:00
James R. Barlow
01c7895044
pipeline: tidy
2021-11-13 14:47:49 -08:00
James R. Barlow
59642a98b2
Disable --remove-background so we can remove leptonica
2021-11-12 23:56:52 -08:00
James R. Barlow
30440104ba
Remove --threshold argument
...
Tesseract is now included better thresholding (binarization) in v5. Users that have
thresholding issues should try that first. If we find further problems
this can be brought back as a plugin.
2021-11-12 20:09:55 -08:00
James R. Barlow
b159e02110
Convert deskew to use degrees, since all our other angles are in degrees
2021-11-12 16:40:51 -08:00
James R. Barlow
a55ab05d16
Replace leptonica deskew with tesseract find skew and pillow rotate
...
Also rebuild the cache.
2021-11-12 16:35:08 -08:00
James R. Barlow
53cd04799a
typing: fix Pillow usage, leptonica
2021-08-27 00:06:38 -07:00
James R. Barlow
4eca0a165b
pre-commit: pyupgrade modernizing
2021-08-26 18:04:38 -07:00
James R. Barlow
051b9da991
Remove undocumented/unused debug environment variables
2021-04-08 21:08:12 -07:00
James R. Barlow
173a80864d
Delinting
2021-04-07 02:09:45 -07:00
James R. Barlow
ec1d585d40
Merge branch 'feature/misc-breaking'
2021-04-01 16:51:04 -07:00
James R. Barlow
a4e1f8e1f3
Merge branch 'feature/lambda'
2021-04-01 16:36:22 -07:00
James R. Barlow
4124889f36
Don't generate PDF/A-1b with object streams
...
Acrobat insists that PDF/A-1b should not have object streams.
Other programs like veraPDF disagree with this restriction, but
we can accommodate Acrobat so we will.
Also add more tests around this.
2021-02-26 00:23:57 -08:00
Dima Kuznetsov and GitHub
5e2206bae7
Allow --sidecar along --pages ( #735 )
2021-02-19 16:55:35 -08:00
James R. Barlow
064f935699
Fix page rotation regression
...
Page size fixes in commit b26749 did accounted for a "kept" rotation,
but not a corrected rotation.
Fixes #730 .
2021-02-15 01:47:09 -08:00
James R. Barlow
a48ca556c7
Add filter_pdf_page hook
2021-02-14 01:22:33 -08:00
James R. Barlow
bccf2f423f
Stricter parameter checking for many public functions
2021-01-31 19:27:25 -08:00
James R. Barlow
85c6a974ca
Fix calls to hook.get_executor
2021-01-31 02:46:44 -08:00
James R. Barlow
b1da09f141
Add plugin for setting logging console
...
So that we are not tied to tqdm.
2021-01-31 02:29:11 -08:00
James R. Barlow
d274d88929
Refactor to eliminate global state in _concurrent
2021-01-30 17:36:30 -08:00
James R. Barlow
91aa175602
Consider text when determining page raster DPI
...
Previously if we found vectors of any sort on a page, we would bump
the DPI up to 400. We did nothing
about pages with text. As a result,
pages with a low image resolution
and printable text would have the text downgraded to image
resolution when --force-ocr was used.
We don't try to determine if the text is visible or invisible OCR text, since
that is a slower test. --redo-ocr would improve such cases anyway.
2021-01-09 16:01:49 -08:00
James R. Barlow
b267494e4a
Create raster PDF pages to match input page size
...
Previously we produced a raster image, then multiplied image width
by DPI to get the page size. However if there is rounding the
page size may not match exactly. In this modified approach we
constrain the page size to match.
2021-01-08 15:10:43 -08:00
James R. Barlow
96d68c2413
pipeline: refactor metadata_fixup
2020-12-29 01:47:32 -08:00
James R. Barlow
bb258fc99c
pdfinfo: Refactor pageinfo dictionary into a class
2020-12-24 01:47:53 -08:00
James R. Barlow
68a57a7839
Add feature to generate hocr-pdf with visible debug text
2020-12-04 17:38:48 -08:00
James R. Barlow
ce0e0ecd4d
Decouple tqdm from progressbar setup
2020-12-04 13:20:28 -08:00
James R. Barlow
36e9a54f02
Remove extraneous page rotation
...
This was added in commit b5ccbfd but seems to have been ill-advised.
2020-11-03 01:34:28 -08:00
James R. Barlow
b5ccbfdf25
Fix hookspec of rasterize_pdf_page to remove default parameters
2020-10-24 02:35:18 -07:00
James R. Barlow
31994258fb
metadata fixup: don't try to update original PDF's metadata with docinfo
2020-09-08 02:35:16 -07:00
James R. Barlow
e6a7b58863
Merge branch 'de-gpl'
2020-08-12 12:20:38 -07:00
James R. Barlow
9b641055e1
Fix KeyError: 'dpi' when using --threshold on image to PDF
...
Fixes #607
2020-08-07 02:21:02 -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
c9bd87254e
A few minor typing issues
2020-06-22 02:31:53 -07:00
James R. Barlow and James R. Barlow
f4cb424451
Support input/output streams at API level
2020-06-22 02:02:18 -07:00