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
72156b5653
Degrade more gracefully when --optimize is set but JBIG2 is not present
2018-10-03 14:24:20 -07:00
James R. Barlow
9a8ec4b210
optimize: only enable lossy JBIG2 for -O3
2018-10-03 00:38:58 -07:00
James R. Barlow
75aad4cc79
optimize: Refactor convert_to_jbig2
2018-10-02 23:42:12 -07:00
James R. Barlow
4b27feca98
optimize: Disable JBIG2 lossy mode, use lossless instead
2018-10-01 12:28:54 -07:00
James R. Barlow
45522cd15f
weave: clarify comment about garbage data in ToC
2018-09-27 13:48:35 -07:00
James R. Barlow
677d9a4e76
Remove some unhelpful lambdas
2018-09-27 13:48:12 -07:00
James R. Barlow
efa7ea4fde
Fix log.error where log is None
2018-09-19 23:01:27 -07:00
James R. Barlow
137a6e45f5
ghostscript: fix missing fspath for py3.5
2018-09-19 22:57:20 -07:00
James R. Barlow
cfd4f8a850
Improve error handling for improvements to Ghostscript text extraction
2018-09-19 20:29:18 -07:00
James R. Barlow
ef70e538f7
Improve error message on handling KeyboardInterrupt
...
Closes #301
2018-09-19 01:40:26 -07:00
James R. Barlow
b7b912e56a
Fix test suite and blank pages
2018-09-17 01:12:58 -07:00
James R. Barlow
4615cf2f1e
First cut at improving text extraction speed
2018-09-16 23:34:18 -07:00
James R. Barlow
96ba75eabd
Ghostscript: fix issues in strict ASCII implementation
2018-09-16 15:41:54 -07:00
James R. Barlow
fdfe52c1ad
main: add debug option to force threads
2018-09-15 00:01:45 -07:00
James R. Barlow
932b2e2a29
main: print Ghostscript version too
2018-09-14 23:58:06 -07:00
James R. Barlow
57e489c957
main: Cleanup; support overriding sys.args in run_pipeline
2018-09-14 23:57:35 -07:00
James R. Barlow
17a3fa671c
ghostscript: API docs update
2018-09-14 23:51:52 -07:00
James R. Barlow
7392115507
Blacklist Ghostscript 9.24 due to regressions
...
As per issue #291 . Forced push to remove a copyrighted test file that was
accidentally included.
2018-09-14 20:41:13 -07:00
James R. Barlow
686207ab7f
Check for and reject Adobe LiveCycle Designer PDFs
...
These are the ones that display a "Please wait..." message.
Closes #296
2018-09-13 21:50:51 -07:00
James R. Barlow
517b385fe5
Work around loss of Unicode DOCINFO in Ghostscript 9.24+
...
Ghostscript no longer supports UTF-16-BE-hex strings as a way of
supplying Unicode data in pdfmark so we have lost this functionality too:
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=e997c6836d243ab37fe3a5f0d57974af95eb5eac
For users this means setting --title, --author, etc. will not work if gs
9.24 is installed, but if the file has existing metadata it might work.
For now we enforce police-state-strict ASCII, until there's time to
implement proper metadata editing. Relevant tests set to xfail.
2018-09-13 21:33:39 -07:00
James R. Barlow
795019b0c1
Work around invalid TOC entries
...
Kodak Capture Desktop and probably other software creates a
/Outlines entry with /First being set to an invalid indirect reference to
an object that hasn't been created. This is legal in the PDF spec but
problematic for qpdf. The objgen will be (max valid object ID + 1, 0).
Because we create new objects in _weave, some TOC entries will end
up assigned to new objects we create. Typically /ProcSet.
We solve the issue by refactoring page traversal and then doing it
twice, once to resolve all references (eliminating the null
reference problem) and a second pass to make our changes.
2018-09-11 14:44:16 -07:00
James R. Barlow
3127a73822
Ghostscript: no need to specify ProcessColorModel when ColorConversionStrategy
2018-09-11 11:56:05 -07:00
James R. Barlow
069ee6c91f
ghostscript: fix for 9.24 having jpeg passthrough available
2018-09-10 23:09:51 -07:00
James R. Barlow
a96710aa7b
leptonica: update comments
2018-09-10 11:47:38 -07:00
James R. Barlow
edcc58826a
pdfinfo: remove some dead code
2018-09-10 11:47:00 -07:00
James R. Barlow
4d5c9b8cdf
Fix error in optimize.py on PNGs at -O2
...
Error was
TypeError: unsupported operand type(s) for -: 'tuple' and 'int'
2018-08-20 15:45:34 -07:00
James R. Barlow
1e23ea5364
Remove pikepdf < 0.3 compatibility shims since > 0.3.1 is now required
2018-08-10 17:01:03 -07:00
James R. Barlow
8013fd50da
Draw preview image at full resolution
...
As reported in #281 and confirmed by the test file in #279 , downsampling
the preview adversely affects quality of image rotation especially for
small font sizes and marginal scans.
Full size gets rotation accuracy. This makes rotation a little inefficient
since it rasterizes twice - to be addressed later.
2018-08-03 13:32:10 -07:00
James R. Barlow
6ef26516d1
pipeline: revise logic of rotations to fix pages with nonzero /Rotate
2018-08-03 00:53:29 -07:00
James R. Barlow
bb50501369
ghostscript: never use autorotatepages
...
It looks like from the gs manual that this parameter is only respected for
vector devices so it never had any effect, but to stay on the safe side,
which it off.
2018-08-03 00:44:34 -07:00
James R. Barlow
4509ca6e75
pipeline: remove unused function
2018-08-03 00:41:08 -07:00
James R. Barlow
c171cb7286
Merge img2pdf 0.3.0 fix from v6.2.3
2018-08-01 15:17:33 -07:00
James R. Barlow
1d09061130
Revert previous commit amd reject input images with alpha channel
...
Decided on this for simplicity of old release branch.
Modifies baiona.png by stripping
alpha, adds baiona_alpha which
includes the alpha.
2018-07-31 23:45:28 -07:00
James R. Barlow
a2203b2447
Discard alpha channel when triaging images
2018-07-25 22:23:41 -04:00
James R. Barlow
755f6e0979
optimize: Use new pikepdf Object.write API
2018-07-13 23:52:36 -07:00
James R. Barlow
95b2830d17
Support removal of Null from pikepdf
2018-07-13 23:50:35 -07:00
James R. Barlow
e774b4650b
ocrmypdf.exec: trap FileNotFoundError too
2018-07-12 03:01:01 -07:00
James R. Barlow
8f8e6dcdd4
Fix problem iterating ruffus exceptions and rotate-pages-threshold parameter validation
2018-07-12 02:59:38 -07:00
James R. Barlow
9f02de55be
main: do better parameter validation
2018-07-12 02:46:52 -07:00
James R. Barlow
7394a4cf49
Cherrypick warning about --user-words not having any effect
...
Might be available in full release of Tess4
2018-07-12 02:46:34 -07:00
James R. Barlow
ed9fb110b1
Fix a comment about Tesseract behavior in certain versions
2018-07-12 02:46:34 -07:00
James R. Barlow
4650074428
Cherrypick Python 3.7 documentation updates from v7.0.0
...
From b0eacd6
2018-07-12 02:45:51 -07:00
James R. Barlow
70aa644c10
Backport Python 3.7 fix for ruffus 2.7.0 from ocrmypdf v7.0.0
2018-07-12 02:45:51 -07:00
James R. Barlow
2ccb3edc58
Ignore masks when deciding what color to rasterize at
2018-07-12 02:45:51 -07:00
James R. Barlow
316709c291
Fix typo introduced in
...
338593d
2018-07-09 21:07:58 -07:00
James R. Barlow
0d6a2ba554
Declare certain APIs public
2018-07-09 14:28:37 -07:00
James R. Barlow
338593d9e7
Remove ruffus 2.6.3 exception special casing
2018-07-09 13:56:23 -07:00
James R. Barlow
58642aa98b
Fix issue #275 : doesn't work when installed in non-Unicode path
...
Closes #275
2018-07-07 01:35:05 -07:00