James R. Barlow
17cd655752
Don't utf-8 decode tesseract --print-parameters
...
Output not guaranteed to be UTF-8.
Fixes #543 .
2020-04-28 02:37:17 -07: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
c5edff2c2f
Sort imports
2019-12-19 15:31:18 -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
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
06a1f987d4
Use _OCRMYPDF_TEST_PATH for testing and .py stubs to simulate symlinks
2019-12-04 21:01:06 -08:00
James R. Barlow
e63503d64b
Fix difference in Windows error message breaking test_no_languages
2019-12-04 17:13:51 -08:00
James R. Barlow
72d3ee3a87
Refactor symlink usage to support Windows
2019-12-04 17:13:51 -08:00
James R. Barlow
9b2ab92913
tesseract: fix exception when logger is RootLogger
2019-11-11 22:19:01 -08:00
James R. Barlow
45bea1c0e0
Import and docstring cleanup
2019-11-09 14:56:30 -08:00
James R. Barlow
979b0bcaed
tesseract: refactor logging
2019-11-05 15:38:09 -08:00
James R. Barlow
6e99e7b346
Use lstm_use_matrix for --user-words,patterns
2019-10-20 00:49:11 -07:00
James R. Barlow
4d26867dee
Delinting
2019-09-20 17:17:11 -07:00
James R. Barlow
feff1e38bb
Use context managers to ensure Pillow images are closed
2019-09-03 17:19:12 -07:00
James R. Barlow
11ef78a891
Fix running without eng.traineddata installed raises exception
2019-08-27 14:54:03 -07:00
James R. Barlow
5f00e4f9d8
Sort imports
2019-07-27 04:51:52 -07:00
James R. Barlow
5304c631ec
Don't warn about --user-words in Tesseract 4.1 or later
2019-07-27 02:14:59 -07:00
James R. Barlow
20ad032977
Fix some error messages that printed directly to sys.stderr instead of logging
2019-06-05 03:07:48 -07:00
James R. Barlow
eb5200d26a
Change most tests to use ocrmypdf API instead of subprocess
...
The main benefit of this is code coverage gains can actually follow it.
Also removes most ugly os.environ hacks.
2019-06-03 01:45:27 -07:00
James R. Barlow
486f73d5d6
Remove custom logger
2019-05-15 02:28:13 -07:00
mawi
c92ccc6134
fix: tests
2019-04-08 14:57:42 +02:00
Martin Wind
aa512b6181
feat: move to sync (none ETL) implementation (WIP)
2019-04-02 20:03:09 +02:00
James R. Barlow
19e35db2b7
Fix issue when weave handoff occurs with no OCR font present
...
If using --tesseract-timeout 0 and any image processing on a file with
more than 100 pages, the weave handoff will occur. Ensure this
works correctly even if no Glyphless font is present.
Closes #347
2019-02-10 02:05:59 -08:00
James R. Barlow
03ab5a8ee2
If --tesseract-timeout 0, say nothing when we time out
...
This is our "don't actually OCR" mode. No need to mention it.
2019-02-08 13:04:48 -08:00
James R. Barlow
c771938907
Convert to f-strings where it makes sense
2018-12-31 15:01:19 -08: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
8b90c45437
Drop support for Tesseract 3
2018-12-30 00:47:12 -08:00
James R. Barlow
72b920eb16
Drop support for Python 3.5
2018-12-30 00:23:26 -08:00
James R. Barlow
cc7f2a3f02
Fix Python 3.5 pathlib regressions
2018-11-10 02:11:23 -08:00
James R. Barlow
5ed05e08b1
Fix "no languages" test and misuse of os.environ
2018-11-09 01:57:11 -08:00
James R. Barlow
fb8b161f6c
Fix suppression of tesseract config error messages
2018-10-03 17:39:50 -07:00
James R. Barlow
6f554c6ae8
tesseract: account for behavior changes when params are missing
...
Tesseract 4.0-rc1 now accepts invalid parameters in config and
won't return an error anymore. We prefer to raise an error if this
occurs.
See: https://github.com/tesseract-ocr/tesseract/commit/741ea00d7059d8ff7c55797ffc525a461d7f3ced
2018-10-03 15:11:34 -07:00
James R. Barlow
b7ff821fa3
Fix recent versions of tesseract not registering as textonly_pdf
...
This change happened sometime after the 4.0.0-beta1 release in
Ubuntu 18.04
2018-06-23 02:55:58 -07:00
James R. Barlow
76532649b8
tesseract.get_orientation: removed unused language parameter
2018-06-23 01:48:24 -07:00
James R. Barlow
b0dbaeafc5
Cleanup unused imports
2018-06-23 01:47:53 -07:00
James R. Barlow
a13c398c06
Suppress some spurious tesseract errors
2018-06-05 23:26:28 -07:00
James R. Barlow
9608b22d34
Remove all uses of PyPDF2 except PDF/A check
...
Leave PDF/A check alone for now, since pikepdf has no equivalent.
2018-05-26 02:07:18 -07:00
James R. Barlow
f3b6d9dcdf
Fix a comment about Tesseract behavior in certain versions
2018-05-01 21:31:09 -07:00
James R. Barlow
54150a14e9
Further elimination of tesseract renderer special casing
...
We don't need to keep a "skip page" around anymore since
skipping means just not grafting on the text layer.
2018-05-01 13:36:20 -07:00
James R. Barlow
88ff091cce
Unify tesseract and sandwich renderer paths
...
Since the new weaving method copies the font and content
stream from the Tesseract PDF, it doesn't matter if Tesseract
happens to have an image or not.
If Tesseract is text-only capable we use that feature for efficiency,
but ignore the image either way.
2018-05-01 13:24:20 -07:00
James R. Barlow
e7286f6129
Unsplit now works with multipage, --force-ocr
2018-04-30 14:46:20 -07:00
James R. Barlow
1caebaefb5
tesseract: Fix FileExistsError on if output file was created at timeout
2018-03-25 21:38:20 -07:00
James R. Barlow
af085b79dd
Move ocrmypdf to src/ocrmypdf
2018-03-24 23:59:08 -07:00