James R. Barlow
5ed05e08b1
Fix "no languages" test and misuse of os.environ
2018-11-09 01:57:11 -08:00
Stefan Weil and jbarlow83
a873278c2a
Fix some recommendations from LGTM ( #309 )
...
* Fix unreachable code
This fixes an issue reported by LGTM.
Signed-off-by: Stefan Weil <sw@weilnetz.de >
* Remove unused imports
This fixes several recommendations from LGTM.
Signed-off-by: Stefan Weil <sw@weilnetz.de >
2018-10-28 13:59:58 -07:00
James R. Barlow
fa48205bb8
Add feature to remove vector graphics objects
2018-10-18 21:46:08 -07:00
James R. Barlow
5c229d48d5
optimize: Reorganize so JBIG2 can be performed on images reduced to 1bpp
...
Closes #297
2018-10-04 11:53:11 -07: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
72156b5653
Degrade more gracefully when --optimize is set but JBIG2 is not present
2018-10-03 14:24:20 -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
137a6e45f5
ghostscript: fix missing fspath for py3.5
2018-09-19 22:57:20 -07:00
James R. Barlow
4615cf2f1e
First cut at improving text extraction speed
2018-09-16 23:34:18 -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
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
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
47885f4230
Remove initial qpdf.repair
...
Since pikepdf is doing the work the initial repair takes time and gives
little benefit.
It turns out to not be worthwhile to
save the results of PdfInfo parsing,
since the time to save this seems to exceed the costs of recalculating
it since the "weave" code. At least
for small files.
2018-07-03 16:50:05 -07:00
James R. Barlow
921767e82e
ocrmypdf.exec: trap FileNotFoundError too
2018-07-03 00:05:49 -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
6333ec928c
Cleanup some cases where log was lazy and should be
2018-06-23 01:50:27 -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
94150f414a
Remove qpdf.merge
...
We no longer need to merge pages this way. Much of the functionality
was there to implement page splitting without hitting ulimit which
will be fixed in qpdf > 8.0.2. The tests were expensive to run.
Also remove pytest-timeout since it breaks the Linux build.
2018-06-23 00:45:03 -07:00
James R. Barlow
faaa4a1def
Ghostscript, PDF/A: support pathlib
2018-06-22 17:45:10 -07:00
James R. Barlow
8c84c515b6
Use Ghostscript for text region detection
...
Ghostscript txtwrite seems to be quite effective at the task.
Eliminates dependency on fitz
2018-06-13 00:58:09 -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
93b858afd1
Remove qpdf appimage support for now, check for pngquant
2018-05-18 16:24:33 -07:00
James R. Barlow
d5fb275e9e
Travis: hack in qpdf appimage version
...
qpdf from appimage does not report its version with --version if renamed
or accessed via symlink. Use an environment variable to supply it
where needed.
2018-05-15 17:45:58 -07:00
James R. Barlow
4809627d8a
Fix jbig2enc name
2018-05-11 17:51:08 -07:00
James R. Barlow
d9bbb80a6b
Don't try to run jbig2 when not available
2018-05-11 12:42:00 -07:00
James R. Barlow
72253d09fa
Add arguments to control optimization
2018-05-10 22:23:24 -07:00
James R. Barlow
3026d86a9e
Remove jbig2enc.py
2018-05-10 21:15:07 -07:00
James R. Barlow
0661a7edc3
Merge optimize
2018-05-10 21:05:32 -07:00
James R. Barlow
d787e1ea0f
ghostscript.py not saved in last commit
...
Given importance of last one, confirmed that when the file is saved all tests pass too.
Passing is invariant with this change.
2018-05-01 22:59:22 -07:00
James R. Barlow
b5d7e9cbb0
Fix all issues with rotations
...
All tests now pass
2018-05-01 22:50:20 -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
37677de884
Fix regressions: pdfa.ps not used, PDF/A failures, handling of text layers with no font
2018-05-01 15:51:46 -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
9e89b75186
Merge v6.1.5
2018-04-17 22:51:13 -07:00
James R. Barlow
0b10db91be
Fix regression: Disable Ghostscript JPEG passthrough entirely
2018-04-17 17:00:24 -07:00
James R. Barlow
076363d78e
Disable JPEG passthrough for Ghostscript 9.23
...
Seems to corrupt JPEGs involved in image masks?
2018-04-17 16:31:03 -07:00
James R. Barlow
a009ca7597
Disable JPEG passthrough for Ghostscript 9.23
...
Seems to corrupt JPEGs involved in image masks?
2018-04-17 13:54:34 -07:00
James R. Barlow
f755fb76ee
Try pngquant
2018-04-14 01:37:14 -07:00
James R. Barlow
136da74bfa
Update branch with v6.1.4
2018-04-13 12:57:21 -07:00
James R. Barlow
7fc897e6dc
Fix NameError 'ghostscript'
2018-04-12 21:24:05 -07:00
James R. Barlow
9b731d63b8
Set Ghostscript -sColorConversionStrategy the way old/new versions expect
2018-04-12 16:28:48 -07:00
James R. Barlow
10aa59f674
v6.1.4 fix test suite regression with Ghostscript 9.23
2018-04-12 15:16:54 -07:00
James R. Barlow
c95db246d4
v6.1.4 merge
2018-04-11 15:58:00 -07:00