James R. Barlow
b3b61c152c
Handle malformed DocumentInfo ( #497 )
...
User submitted a PDF in which /Trailer /Info pointed to the XMP metadata
block instead of a DocumentInfo dictionary. Fix and add test.
2020-03-03 03:27:01 -08:00
James R. Barlow
f6d7aa6e33
Refactor page rotation and re-enable message at info level
2020-01-30 17:35:20 -08:00
James R. Barlow
bcf77375c0
Fix grammar in output message
2020-01-28 07:33:28 -08:00
James R. Barlow
e860c56b75
Fix regression: metadata updates not taking effect
2020-01-17 23:01:37 -08:00
James R. Barlow
ce97af5a79
Add OCR quality measurement API
2020-01-17 03:10:27 -08:00
James R. Barlow
3831c4cd4d
Refactor metadata_fixup
2020-01-14 01:10:15 -08:00
James R. Barlow
123fde174d
Don't use debug.log in pytest
...
pytest does not reset the state of logging if we install a file handler,
which will cause FileNotFoundError after the temporary folder is removed.
Semi-related:
https://github.com/pytest-dev/pytest/issues/5502
2020-01-06 01:46:19 -08:00
James R. Barlow
6f5d77d930
Also generate log file in temp folder on verbose mode
2020-01-05 21:33:32 -08:00
James R. Barlow
5b6ab1e003
lept: improve lib not found error message
...
Closes #471
2020-01-05 01:05:53 -08:00
James R. Barlow
32041c43e1
tests: improve tesseract coverage
2020-01-04 02:35:14 -08:00
James R. Barlow
599028bebb
tesseract: don't explicitly set lstm_use_matrix
...
Apparently tesseract does this own its own as needed.
2020-01-04 01:17:33 -08:00
James R. Barlow
6faa8f7221
logging: always log process arguments and stderr when at debug
...
Also remove ad-hoc logging of this information.
2020-01-01 16:48:48 -08:00
James R. Barlow
a4dc5e365f
logging: fix incorrect usage: logging.Logger()
2020-01-01 16:47:36 -08:00
James R. Barlow
e2a563cc76
logging: create a debug log when -k parameter is issued
2020-01-01 16:47:15 -08:00
James R. Barlow
2f1c743227
Rewrite main pool loop
...
pytest-cov documentation recommends using explicit
management of multiprocessing.Pool rather than the context manager.
This is supposed to work better for collecting coverage data, particularly
on Windows.
2019-12-31 16:23:41 -08:00
James R. Barlow
16dd8b54a8
ghostscript: don't delete output_file that will never exist
...
We stream output now, so no point in deleting.
2019-12-30 22:38:38 -08:00
James R. Barlow
c4dc5269d2
tests: remove some obscure things from coverage
2019-12-30 21:16:16 -08:00
James R. Barlow
c36e9950ae
tests: test TqdmConsole
2019-12-30 17:51:09 -08:00
James R. Barlow
0c0d53b10f
tests: AcroForm test case did not work correctly; fixed
2019-12-30 17:50:32 -08:00
James R. Barlow
63de7e1677
Improve error message for unreadable input files
2019-12-30 16:14:52 -08:00
James R. Barlow
b0e92760a2
tests: add coverage for helpers
2019-12-30 15:52:10 -08:00
James R. Barlow
708113a514
Windows: Remove Program Files cache from ocrmypdf.exec
...
@lru_cache doesn't work here, so let's just remove it.
2019-12-29 02:36:20 -08:00
James R. Barlow
868b3b4abd
exec/init: os.get_exec_path() returns list not str
2019-12-28 16:11:08 -08:00
James R. Barlow
a53a3937c2
Fix exception on parsing Ghostscript error messages
2019-12-20 11:25:45 -08:00
James R. Barlow
c5edff2c2f
Sort imports
2019-12-19 15:31:18 -08:00
James R. Barlow
39da931a56
Look in Program Files for executables and liblept5.dll
2019-12-19 12:11:32 -08:00
James R. Barlow
9fe354359b
Generally update documentation about available platforms
2019-12-19 00:27:37 -08:00
James R. Barlow
9559b0b186
Use pikepdf to perform qpdf.check()
2019-12-11 01:21:15 -08:00
James R. Barlow
91456e19a4
pdfa.py: Fix misleading comment
2019-12-11 01:05:47 -08:00
James R. Barlow
a2d89f67c4
Improve help messages for Windows
2019-12-10 01:44:00 -08:00
James R. Barlow
f34130d193
Fixed case where page image was not converted to JPEG
...
If a preprocessing option was used,
and all original images on the page were JPEGs,
and --output-type=pdf, then
images would saved as Flate instead
of converted to JPEG.
2019-12-10 01:07:59 -08:00
James R. Barlow
c5571388e2
Improve test coverage of _sync.py
2019-12-10 01:06:27 -08:00
James R. Barlow
b354511ac9
ghostscript: document need to write to stdout when using txtwrite
2019-12-09 16:17:10 -08:00
James R. Barlow
65855dc14c
Fix close_fds=True on Windows Python 3.6
2019-12-09 16:17:10 -08:00
James R. Barlow
cac4a8b9b6
Suppress duplicate error messages from Ghostscript
2019-12-06 15:14:15 -08:00
James R. Barlow
1c1b60fa9f
Add typing hints for ocr() function
2019-12-06 15:10:54 -08:00
James R. Barlow
6b745d892f
Merge branch 'windows'
2019-12-06 15:09:09 -08:00
James R. Barlow
fbf271a3ec
Remove Tesseract < 4.0 specific check
2019-12-06 15:06:02 -08:00
James R. Barlow
8077718804
Possible fix to loss of log adapter state
2019-12-06 15:05:58 -08:00
James R. Barlow
b8b7ecfe7f
Fix DecompressionBomb related errors due to Windows process differences
2019-12-04 21:10:27 -08:00
James R. Barlow
cb3cfaa055
Add Windows install advice
2019-12-04 21:01:09 -08:00
James R. Barlow
9db01c7ff5
Remove test_bad_utf8
...
Due to difficulties of getting this to work on Python 3.8, Windows, and
high probability that this behavior is now gone from Tesseract 4.0+.
Originally added in 2017.
2019-12-04 21:01:09 -08:00
James R. Barlow
d0301813cc
ghosttext: mention page number differences
2019-12-04 21:01:09 -08:00
James R. Barlow
06a1f987d4
Use _OCRMYPDF_TEST_PATH for testing and .py stubs to simulate symlinks
2019-12-04 21:01:06 -08:00
James R. Barlow
e51e21c6b6
ghostscript: Refactor checking for executable name on Windows
2019-12-04 21:01:06 -08:00
James R. Barlow
c5fa72bd4e
ghostscript: use run(check=True) for more consistent error handling
2019-12-04 21:01:00 -08:00
James R. Barlow
bf99587aa1
ghostscript: use correct executable name on Windows
2019-12-04 17:37:38 -08:00
James R. Barlow
d249aef57d
ghostscript: don't use NamedTemporaryFile
...
Temporary files are more awkward for Windows.
2019-12-04 17:37:38 -08:00
James R. Barlow
43ab7c88d7
Remove os_environ() context manager
2019-12-04 17:37:38 -08:00
James R. Barlow
3f92867ae6
Fix TypeError "environment can only contain strings"
...
Apparently Windows Python doesn't coerce pathlib.Path to str.
2019-12-04 17:13:51 -08:00