James R. Barlow
83230097ae
Insist on Tesseract 3.04 wherever we check for it
2017-05-11 23:51:28 -07:00
James R. Barlow
8f91acf956
Remove Tesseract 3.02 and 3.03 compatibility shims
2017-05-11 23:50:52 -07:00
James R. Barlow
56e6ed1249
Fix missing import; all tests passing!
2017-05-11 23:28:05 -07:00
James R. Barlow
0dae1602c7
Fix missing import PIPE
2017-05-11 23:07:20 -07:00
James R. Barlow
96045e98f4
Update develop with master changes
...
We’re well out of the “trivial updates” zone
2017-05-11 22:54:27 -07:00
James R. Barlow
01b7205e2c
Ensure skipped pages are explained in sidecars
2017-05-11 00:43:36 -07:00
James R. Barlow
c8a4cbcf17
Fix test suite breakage after sidecar feature added
...
Forgot to update tesseract spoofers to account for change in tesseract
parameters. Also the change to outputting multiple files in the collate
steps affected how ruffus passes information into downstream consumers
of those files.
2017-05-11 00:17:24 -07:00
James R. Barlow
16b6442b23
Add changes to __main__.py that should have been in last commit
2017-05-10 17:55:42 -07:00
James R. Barlow
183eafa587
Implement sidecar text files ( #126 )
2017-05-10 15:22:44 -07:00
James R. Barlow
47a2997538
Reorganize —help text
2017-05-10 12:19:56 -07:00
James R. Barlow
1606b6a383
Add —quiet ( fixes #143 ), stop using ruffus to partially generate argparser
2017-05-09 17:24:06 -07:00
James R. Barlow
2a61902df5
Merge commit 'c4f01de231d22da5cea02c25aa581a965a37640b'
2017-05-09 16:37:55 -07:00
James R. Barlow
01a1c2b576
Implement —pdfa-image-compression to control Ghostscript’s compression
...
Fixes #163
2017-05-09 16:37:29 -07:00
Ingo Feinerer and jbarlow83
c4f01de231
Fix typo "cutput" -> "output" ( #164 )
...
[ci skip]
2017-05-09 16:22:10 -07:00
James R. Barlow
93e802f473
Fix issue #163 , color and grayscale images JPEG compressed when not needed
2017-05-06 22:27:25 -07:00
James R. Barlow
aa859a4139
Fix #156 - NoneType has no ‘getObject’ for pages with no /Contents
2017-05-01 15:46:15 -07:00
James R. Barlow
b9b12e2879
Ensure that ocrmypdf stops and reports an error if Ghostscript fails
...
Past behavior was to continue and let ruffus puke eventually
2017-05-01 15:44:21 -07:00
James R. Barlow
cf643c9f43
Fix argparse.ArgumentError needs two positional args
2017-05-01 14:55:47 -07:00
James R. Barlow
6c8c1d8173
Fix #154 : KeyError ‘/Contents’ on blank pages with /Contents record
2017-04-28 15:22:05 -07:00
Jakub Wilk and jbarlow83
2846fb4e31
Remove misplaced flags from re.sub() call ( #153 )
...
The 4th argument of re.sub() is maximum number of substitutions,
not flags.
Moreover, re.MULTILINE affects only semantics of ^ and $,
so it wouldn't have any effect on this regular expression.
2017-04-20 00:38:23 -07:00
James R. Barlow
fee22b6b0b
Fix #151 , cannot write mode P as JPEG
...
all(<empty generator>) is True.
2017-04-18 18:08:45 -07:00
Tom and jbarlow83
345256ee99
Fix --skip-big when there are no images in pdf ( #152 )
...
* fixed skip-big when there are no images in pdf
* added only_text pdf
* updated only_text pdf
* Delete only_text.pdf
2017-04-18 15:19:24 -07:00
James R. Barlow
7b7e3a3e03
Enable lossless reconstruction for —pdf-renderer tess4 where appropriate
2017-03-29 23:44:12 -07:00
James R. Barlow
1e7fbd4202
Fix issues with —pdf-renderer tess4 page skipping
...
If tess4 renderer needed to skip OCR on a page it would end up
duplicating the page contents onto the new page, rather than creating
a blank OCR layer and placing it on the output page. This created
duplicated content in output files.
2017-03-29 23:43:26 -07:00
James R. Barlow
8bc6019172
Begin adding new option to redo ocr
2017-03-29 18:15:20 -07:00
James R. Barlow
059f79242e
Phase out subprocess.Popen
2017-03-29 18:15:02 -07:00
James R. Barlow
89599b4812
Drop Python 3.4 compatibility
2017-03-29 15:46:53 -07:00
James R. Barlow
a9f4047a97
Remove backward compatible API deprecations from v4.x
2017-03-29 15:42:54 -07:00
James R. Barlow
23227ae763
Deprecate old files
2017-03-29 15:41:52 -07:00
James R. Barlow
4a9e9e9db2
v4.5.3 release notes
2017-03-29 13:19:34 -07:00
James R. Barlow
88ef2718f1
Reject high Unicode metadata at command line
...
Ghostscript 9.21 does not seem to accept Unicode above U+FFFF. Previous
versions did, but it now exits with a rangecheck error (-15).
Reject on the command line for now. Complete fix would also need to
check input PDF’s metadata.
2017-03-28 11:08:38 -07:00
James R. Barlow
e71e8ca3ad
Workaround for GS VMerror -25 bug
...
Avoid inserting docinfo keys that would be translated to null strings,
to avoid running afoul of
https://bugs.ghostscript.com/show_bug.cgi?id=697684
2017-03-28 11:05:43 -07:00
James R. Barlow
45e9257d6e
Don’t use filename “pdfa_def.ps” for GS file
...
At recommendation of Artifex people, don’t use the filename pdfa_def.ps
because if given without a full path Ghostscript will prioritize
searching its own resources over the current directory, and will pick up
the example file pdfa_def.ps instead. We used the full path anyway,
but this is a prudent defensive change to avoid odd Ghostscript behavior.
2017-03-28 11:02:46 -07:00
James R. Barlow
2954e72652
Some examples of Ghostscript and Tesseract warnings/errors were not tagged properly
2017-03-28 10:59:53 -07:00
James R. Barlow
199de96cff
Ghostcript 9.21 seems to have a regression related to Unicode metadata
2017-03-24 15:15:46 -07:00
James R. Barlow
8ddbe81513
Fix issue #147 : unpaper loses DPI information, affects —pdf-renderer tess4
2017-03-24 13:23:03 -07:00
James R. Barlow
a3e26e0498
Make —pdf-renderer tess4 more informative, less FUD
2017-03-24 12:58:40 -07:00
James R. Barlow
f035cb1088
Fixed issue #142 — closed streams raise an exception on fork attempt
2017-03-13 15:52:57 -07:00
James R. Barlow
7cd2770a13
Fix issue #137 - proportions of non-square resolution distorted
...
Distortion mainly affected —force-ocr
2017-02-26 17:13:16 -08:00
James R. Barlow
d1a0065ef8
Create test case for Form XObjects
2017-02-14 12:51:15 -08:00
James R. Barlow
5a817370fd
Warn more strongly about —pdf-renderer tesseract until fix is widely propagated
2017-02-14 11:33:07 -08:00
James R. Barlow
5e14274f10
pageinfo: learn to extract image information from Form XObjects
2017-02-11 16:48:59 -08:00
James R. Barlow
a0657ad937
Prevent use of —pdf-renderer tess4 on tesseract 3
2017-02-06 13:49:43 -08:00
James R. Barlow
8c17c9918e
Add documentation and test cases for —tesseract-config
...
This parameter has existed for along time but never really got any
attention.
2017-01-28 22:06:51 -08:00
James R. Barlow
99afebd033
tesseract jobs_limit(2)
...
At least on macOS with my quadcore performance improves with two
tesseracts in parallel (20% gain). Hard to say how this will affect
Linux, but stepping up to 2 jobs seems justifiable.
2017-01-27 18:13:12 -08:00
James R. Barlow
65e4b1672f
cffi: verbose=True
2017-01-27 14:17:13 -08:00
James R. Barlow
9a15a4db10
Ensure specified destination is writable before starting pipeline process
2017-01-26 22:08:24 -08:00
James R. Barlow
1976dc6f30
Fix issue #121 “pop from empty list” (content stream parsing error)
2017-01-26 17:24:40 -08:00
James R. Barlow
02fba02d31
Refactor test suite to use fixtures to manage paths
2017-01-26 16:38:59 -08:00
James R. Barlow
bad67c6dc5
Rename ‘tesstop’ to ‘tess4’
...
There’s no reason text-only PDF shouldn’t become the default for
tesseract 4.
2017-01-26 12:28:51 -08:00