James R. Barlow
25cc17ee03
v13 release notes (2)
2021-11-13 02:02:04 -08:00
James R. Barlow
e8098a1475
Dockerfile: remove requirements/
2021-11-13 01:57:17 -08:00
James R. Barlow
6b773883dc
build: use latest pip and wheel in all cases
2021-11-13 01:57:03 -08:00
James R. Barlow
4ed9622335
v13 release notes
2021-11-13 01:37:38 -08:00
James R. Barlow
acc9d58c39
Skip no language test for Tess 5
2021-11-13 01:37:27 -08:00
James R. Barlow
659e738f92
Remove some 'liblept' references we no longer need
2021-11-13 01:22:09 -08:00
James R. Barlow
7b3d7ca92a
ghostscript: choco doesn't put Ghostscript on PATH anymore
...
It seems that chocolately doesn't put gswin[32,64]c on PATH anymore,
so compensate.
2021-11-13 01:18:12 -08:00
James R. Barlow
e3126d2806
Adjust test to support Tesseract 5 working harder to find its files
2021-11-13 01:16:35 -08:00
James R. Barlow
45020a7fcd
build: tweak CI
2021-11-13 00:56:49 -08:00
James R. Barlow
f51164aff8
Upgrade test version of pymupdf
2021-11-13 00:53:41 -08:00
James R. Barlow
6f58a14351
pdfa: remove deprecated pkg_resources based access and tests
2021-11-13 00:52:03 -08:00
James R. Barlow
7ba04267b1
Remove shims to support for old versions of pikepdf < 4
2021-11-13 00:43:20 -08:00
James R. Barlow
9749564313
Remove requirements/*.txt - use pip install ocrmypdf[etc] instead
2021-11-13 00:31:42 -08:00
James R. Barlow
698e8791d7
Remove Python 3.6 specific unicode environment checks
2021-11-13 00:28:52 -08:00
James R. Barlow
380b981763
Remove most Python 3.6 special casing
2021-11-13 00:27:48 -08:00
James R. Barlow
5abfb14c2a
Remove leptonica and cffi
2021-11-13 00:06:35 -08:00
James R. Barlow
036afc4d88
Update cache, related to previous apparently
2021-11-12 23:57:50 -08:00
James R. Barlow
59642a98b2
Disable --remove-background so we can remove leptonica
2021-11-12 23:56:52 -08:00
James R. Barlow
f8c6be2e26
test_rotation: replace leptonica test with Pillow channel ops
...
New function is likely not as robust but seems capable of inexact image comparison.
2021-11-12 23:49:38 -08:00
James R. Barlow
42bf5476dd
optimize: replace leptonica compdata with direct insert of JPEG
...
Confirmed that img2pdf just inserts JPEG verbatim. Never had to go through
the trouble we did.
2021-11-12 23:20:49 -08:00
James R. Barlow
30440104ba
Remove --threshold argument
...
Tesseract is now included better thresholding (binarization) in v5. Users that have
thresholding issues should try that first. If we find further problems
this can be brought back as a plugin.
2021-11-12 20:09:55 -08:00
James R. Barlow
b159e02110
Convert deskew to use degrees, since all our other angles are in degrees
2021-11-12 16:40:51 -08:00
James R. Barlow
a55ab05d16
Replace leptonica deskew with tesseract find skew and pillow rotate
...
Also rebuild the cache.
2021-11-12 16:35:08 -08:00
James R. Barlow
25d046ae95
Modernize OrientationConfidence definition
2021-11-10 00:55:23 -08:00
James R. Barlow
01b0f76e36
Remove duplicate definition of OrientationConfidence
2021-11-10 00:55:07 -08:00
James R. Barlow
d74d315e8b
docs: update some old OS versions
2021-11-10 00:30:48 -08:00
James R. Barlow
8be9a68c5e
v12.7.2 release notes
2021-11-04 00:20:25 -07:00
James R. Barlow
6c34d59836
tesseract: yet another version variant
2021-11-04 00:17:18 -07:00
James R. Barlow
386453d178
pdfa: replace read_binary() with files()
2021-10-31 02:01:11 -07:00
James R. Barlow
615a7561b5
tesseract: tidy some uses of str paths instead of Path
2021-10-31 02:01:05 -07:00
James R. Barlow
c4c64c3ea0
pre-commit updates
2021-10-31 01:31:57 -07:00
James R. Barlow
21279f5784
Fix leaked file handle for output_type none
2021-10-28 02:50:17 -07:00
James R. Barlow
a63a21a7fc
helpers: remove shim for unsupported old version of pikepdf
2021-10-28 02:46:34 -07:00
James R. Barlow
1c4d5d79f7
Improve some error messages
2021-10-28 01:16:22 -07:00
James R. Barlow
644581ed3c
v12.7.1 release notes
2021-10-27 01:20:06 -07:00
James R. Barlow
77f7621bbc
batch.py: tidy
2021-10-15 15:03:40 -07:00
James R. Barlow
42713b77d7
v12.7.0 release notes
2021-10-12 13:39:49 -07:00
James R. Barlow
690f88119d
Fix test failures on pikepdf 3.2.0 + pybind11 2.8.0
...
When compiled without pybind11 2.8.0, pikepdf supplies a shim to implement
pikepdf._ObjectMapping.values() which has subtly different semantics
from a true dict-like objects; in particular it supports
next(objectmap.values())
where a standard dict requires
next(iter(objectmap.values()).
pybind11 2.8.0 now implements .values() properly, meaning some misuses of
protocol in ocrmypdf fail.
If pybind11 < 2.8.0, pikepdf will
continue to offer its shim. If pybind11 >= 2.8.0, pikepdf does not add its shim.
Consequently no changes were needed in pikepdf.
Closes #843
2021-10-12 13:38:52 -07:00
James R. Barlow
78f391536b
Offer hint to user to use --max-image-mpixels after decompression bob error
...
Closes #801
2021-10-06 00:19:11 -07:00
mara004 and GitHub
7bdd1828a9
[ci skip] docs/conf.py: add intersphinx mapping to make external links work ( #838 )
2021-10-04 00:34:59 -07:00
mara004 and GitHub
a8f513eeeb
[ci skip] Update api.rst ( #839 )
2021-10-04 00:34:39 -07:00
fedeliallalinea and GitHub
af18bc0684
fixs importlib.{metadata,resource} for new python version ( #840 )
...
Signed-off-by: Marco Genasci <fedeliallalinea@gmail.com >
2021-10-03 23:30:11 -07:00
James R. Barlow
b621df6947
v12.6.0 release notes
2021-10-02 01:02:17 -07:00
James R. Barlow
313c9e7dc1
docs: add missing sphinx extensions
2021-09-26 23:41:25 -07:00
James R. Barlow
9d04795f7f
docs: fix package version error
2021-09-26 23:41:17 -07:00
James R. Barlow
9a08e71e7f
docs: show logo
2021-09-26 23:40:54 -07:00
James R. Barlow
790d3022f6
Implement --output-type=none to skip producing the PDF and use only the sidecar
...
Closes #787
2021-09-26 01:07:34 -07:00
James R. Barlow
ec311af796
typing: subprocess
2021-09-22 17:18:59 -07:00
James R. Barlow
c725bf79da
flake8 delinting
2021-09-21 16:37:03 -07:00
James R. Barlow
9559f76fae
optimize: fix typo in debug msg
2021-09-19 16:31:00 -07:00
James R. Barlow
45736b7c2b
cli: clarify text to more accurately describe behavior of --jbig2-lossy
2021-09-16 16:03:39 -07:00
James R. Barlow
5629e960b9
v12.5.0 release notes update
2021-09-15 00:27:32 -07:00
James R. Barlow
79fd8d01a5
info: fix incorrect handling of inline images and other typing fixes
2021-09-15 00:26:15 -07:00
James R. Barlow
79fe7a0a85
graft: remove separate implementation of unparse_content_stream
2021-09-15 00:25:06 -07:00
James R. Barlow
b4b32a35b5
optimize: fix typing consistency
2021-09-15 00:09:08 -07:00
James R. Barlow
4634b3db55
v12.5.0 release notes
2021-09-14 17:26:07 -07:00
James R. Barlow
f5053158d4
hocrtransform: fix regression causing hocr text to be not rendered
...
Fixes #828
2021-09-14 17:23:09 -07:00
James R. Barlow
dfa4ce1612
pyproject: configure mypy
2021-09-14 17:22:41 -07:00
James R. Barlow
585595a98e
pre-commit: autoupdate
2021-09-14 17:22:29 -07:00
James R. Barlow
f6396fbaac
pre-commit: drop isort mirror
2021-09-14 17:20:43 -07:00
James R. Barlow
3859bae85e
Merge branch 'feature/drop-pkg-resources'
2021-09-14 00:31:36 -07:00
James R. Barlow
ee1a7baae7
requirements: drop setuptools
...
With importlib_* we no longer setuptools's pkg_resources.
2021-09-14 00:28:42 -07:00
James R. Barlow
a4da05b66b
docs: various fixes
...
As suggested by @Chealer
Closes #829 , #830 , #831 , #832
2021-09-14 00:24:18 -07:00
James R. Barlow
4d67812d51
importlib helpers don't provide importlib.thing, but importlib_thing
...
Fix everywhere.
2021-09-14 00:15:07 -07:00
James R. Barlow
3534742ef9
ci: Enable build of feature branches
2021-09-13 01:35:14 -07:00
James R. Barlow
8bfd46c80d
docs: update copyright
2021-09-13 01:10:49 -07:00
James R. Barlow
cc6e9cecc0
Replace pkg_resources version lookup with importlib.metadata
2021-09-13 01:10:49 -07:00
James R. Barlow
208657f840
pdfa: replace pkg_resources with importlib.resources
2021-09-13 01:10:49 -07:00
James R. Barlow
f3de980447
Introduce importlib-resources,metadata backports for Python < 3.9
2021-09-13 01:10:43 -07:00
James R. Barlow
eb8992e58b
Update release notes
2021-09-09 15:53:08 -07:00
James R. Barlow
72ad618ae6
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-09-09 15:25:54 -07:00
James R. Barlow
f07d0c39bb
Require pikepdf<3 on PyPy 3.6
...
Because cibuildwheel does not build wheels for PyPy 3.6 anymore,
so pikepdf does not offer one.
2021-09-09 15:25:38 -07:00
James R. Barlow
9c5c7d9be0
release notes: mention Py3.6 EOL
2021-09-08 00:04:21 -07:00
0b19b084e2
build(deps): bump pillow from 8.2.0 to 8.3.2 in /requirements/main.txt ( #825 )
...
Bumps [pillow](https://github.com/python-pillow/Pillow ) from 8.2.0 to 8.3.2.
- [Release notes](https://github.com/python-pillow/Pillow/releases )
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst )
- [Commits](https://github.com/python-pillow/Pillow/compare/8.2.0...8.3.2 )
---
updated-dependencies:
- dependency-name: pillow
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-08 00:03:35 -07:00
James R. Barlow
9b4516af7a
ci : add packages for PyPy build
2021-08-31 02:44:07 -07:00
James R. Barlow
1eb45de5c9
v12.4.0 release notes
2021-08-31 02:35:39 -07:00
James R. Barlow
390b9924f5
ci: Add PyPy to matrix
2021-08-31 02:34:12 -07:00
James R. Barlow
c28858a099
leptonica: fix a PyPy-specific error
...
Error is:
TypeError: from_buffer() got a 'memoryview' object, which supports the buffer interface but cannot be rendered as a plain raw address on PyPy
PyPy is happy to access a bytes() copy of the memoryview.
2021-08-31 02:31:58 -07:00
James R. Barlow
f00b3c00cd
Merge remote-tracking branch 'origin/master'
2021-08-31 02:19:09 -07:00
James R. Barlow
4e4f0bfa1f
graft: use faster unparse_content_stream if available
2021-08-31 02:16:25 -07:00
Elliott Sales de Andrade and GitHub
0a31acf888
Allow pluggy v1. ( #822 )
...
There are breaking changes, but I could not find any reference to them
in the code.
2021-08-31 02:15:43 -07:00
James R. Barlow
b91096c615
hoctransform: fix deprecation warning
2021-08-28 02:11:33 -07:00
James R. Barlow
95d9e8d91a
info: inconsistent types used in ContentsInfo.name_index
...
This broke PyPy but CPython is fine with it.
2021-08-28 00:18:14 -07:00
James R. Barlow
cb6c1939e9
typing: fix runtime issues
2021-08-27 02:18:54 -07:00
James R. Barlow
3764ee872a
typing: refactor namedtuples in info
2021-08-27 00:51:11 -07:00
James R. Barlow
e402d5cb4b
typing: fix path and numeric issues
2021-08-27 00:23:38 -07:00
James R. Barlow
53cd04799a
typing: fix Pillow usage, leptonica
2021-08-27 00:06:38 -07:00
James R. Barlow
f2545d4496
typing: remove deprecated abstractstaticmethod
2021-08-26 23:51:11 -07:00
James R. Barlow
9b81e76ed4
typing: fix issues; avoid some magic literals
2021-08-26 23:48:27 -07:00
James R. Barlow
0956fc81aa
typing: improvements for concurrency files
2021-08-26 23:47:53 -07:00
James R. Barlow
72279e7759
typing: confirmed that _pages_from_ranges(not-str) is never used
2021-08-26 23:47:11 -07:00
James R. Barlow
6f9b948064
typing: fix some trivial issues
2021-08-26 23:46:44 -07:00
James R. Barlow
4eca0a165b
pre-commit: pyupgrade modernizing
2021-08-26 18:04:38 -07:00
James R. Barlow
067e61e03a
pre-commit: auto update
2021-08-26 18:00:37 -07:00
James R. Barlow
1b46481f7e
pre-commit: add setup.cfg fmt
2021-08-26 17:59:40 -07:00
James R. Barlow
d8d9c41abb
v12.3.3 release notes
2021-08-21 18:06:14 -07:00
James R. Barlow
a8cad72f72
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-08-21 17:38:19 -07:00
James R. Barlow
86c04305f4
readme: confirm Tesseract 5 support
2021-08-21 17:37:10 -07:00
James R. Barlow
0a110fac55
watcher: fix bool not working as expecting
...
Closes #821
2021-08-21 17:30:14 -07:00
James R. Barlow
f8970ad862
Update CI to test Tesseract 5 and more Linux versions
2021-08-17 02:30:24 -07:00
James R. Barlow
fcfc78b7ee
Move tool config to pyproject
2021-08-17 01:46:22 -07:00
8bb244df24
[ci skip] Update jbig2.rst ( #817 )
...
Co-authored-by: jbarlow83 <jbarlow83@users.noreply.github.com >
2021-08-14 20:05:27 -07:00
James R. Barlow
8a1cb70479
build: adjust pull request again
2021-08-04 03:06:28 -07:00
James R. Barlow
2c579700d6
v12.3.2 release notes
2021-08-04 02:52:45 -07:00
James R. Barlow
87ff6c8301
webservice: tidy flask apis
2021-08-04 02:49:48 -07:00
James R. Barlow
5915259bee
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-08-04 02:49:23 -07:00
Elliott Sales de Andrade and GitHub
969e54f0e3
Allow flask 2 for webservice ( #816 )
...
* Allow flask 2 for webservice.
The breaking changes do not appear to affect it.
* Add shebang to webservice script.
2021-08-04 02:49:13 -07:00
Elliott Sales de Andrade and GitHub
b923612323
Allow watchdog 2. ( #815 )
...
* Allow watchdog 2.
The breaking change was dropping support for macOS 10.12 and earlier,
which doesn't affect us.
* Add shebang to watcher script.
2021-08-04 02:48:25 -07:00
mara004 and GitHub
dc2b161306
docs: Add two commas ( #809 )
2021-08-04 02:47:34 -07:00
James R. Barlow
ae49e3b6db
build: don't try to docker build for third party users
2021-08-04 02:47:03 -07:00
James R. Barlow
0fc5067ab6
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-08-01 01:00:17 -07:00
James R. Barlow
5eb5b5ba73
v12.3.1 release notes
2021-08-01 01:00:14 -07:00
James R. Barlow
aa10a70d70
Rebuild test cache due to hocr output change
2021-08-01 01:00:05 -07:00
James R. Barlow
f99fd686de
hocrtransform: ensure text is rendered in document order
...
Previously we rendered text objects based on their vertical position, but this confuses
some PDF viewers.
Closes #813 .
2021-08-01 00:49:57 -07:00
James R. Barlow
22dd9314ea
logo: add square version
2021-07-20 23:24:17 -07:00
Kai Knoblich and GitHub
73b8b88724
Update the FreeBSD specific parts of the documentation ( #810 )
...
The Python default version was changed from 3.7 to 3.8 at the end of April. For the new quarterly branch, 2021Q3, Python 3.8 has also been the default version since July.
2021-07-20 13:35:19 -07:00
James R. Barlow
4863a8e521
docker: make base install packages in common
2021-07-15 23:33:12 -07:00
James R. Barlow
2366629774
docker: Fix timezone prompt
2021-07-15 23:29:53 -07:00
James R. Barlow
814ad36e51
dockerfile: try newer ubuntu
2021-07-15 19:06:46 -07:00
James R. Barlow
1c2adc3d89
v12.3.0 release notes
2021-07-14 02:38:23 -07:00
James R. Barlow
37923ffe52
Work around Pillow 8.3.1 DPI changes
...
Pillow decided against round-tripping DPI values.
https://github.com/python-pillow/Pillow/pull/5476
Fixes #802
2021-07-14 02:34:28 -07:00
James R. Barlow
773e28478c
graft: don't use deprecated pikepdf APIs
2021-07-14 01:44:26 -07:00
James R. Barlow
e6db071273
Merge remote-tracking branch 'origin/master'
2021-07-14 00:48:30 -07:00
mara004 and GitHub
de74b80335
docs: Fix two missing words ( #805 )
...
* Fix two missing words
2021-07-14 00:48:00 -07:00
James R. Barlow
5cba68b93d
tests: Don't require symlink permissions on Windows
...
Some of tests required symlink permissions, which CI workers have but typical Windows
user accounts do not. Mostly these are just correctness tests.
2021-07-14 00:11:47 -07:00
mara004 and GitHub
d2d39de92f
Update api.rst ( #797 )
...
fix excess 'no'
2021-07-05 14:12:51 -07:00
James R. Barlow
0b834411fe
validation: mention ISO 639-2 to give people a clue about how to find the appropriate code
2021-06-28 15:19:59 -07:00
James R. Barlow
c935ba070b
Fix name of sphinx-rtd-theme
2021-06-23 00:43:30 -07:00
James R. Barlow
e30fffa8a4
v12.2.0 release notes
2021-06-16 00:40:47 -07:00
James R. Barlow
e760be9e19
Drop an obsolete documentation file
2021-06-16 00:39:51 -07:00
James R. Barlow
38280e77f8
Use sphinx-issues to "refactor" release notes
2021-06-16 00:39:40 -07:00
James R. Barlow
6b9b5cc5d5
setup.py shouldn't have a shebang
2021-06-16 00:10:10 -07:00
James R. Barlow
5f01c5e330
Fix another species of Tesseract version number breaking regex
...
Fixes #795
2021-06-16 00:09:03 -07:00
James R. Barlow
5d08303805
docs: plugins - show setup.cfg example
2021-06-14 02:15:52 -07:00
James R. Barlow
7965b1f930
docs: don't suggest unmaintained alternatives, update on GS
2021-06-14 01:08:07 -07:00
James R. Barlow
0a1216bf14
v12.1.0 release notes
2021-06-13 02:26:10 -07:00
James R. Barlow
f10a0f7707
readme: we Docker arm now
2021-06-13 02:20:36 -07:00
James R. Barlow
dc11802809
github templates: ask for more details on feature reqs
2021-06-13 02:20:25 -07:00
James R. Barlow
4cce0077d0
Merge branch 'ci'
2021-06-10 00:30:32 -07:00
James R. Barlow
d293e05946
Adjust readthedocs to not use requirements files
...
Remove .yml since RTD considers it deprecated.
2021-06-10 00:28:38 -07:00
James R. Barlow
4030258bbc
Modernize build system to use setup.cfg
...
For now, keep but deprecate the requirements/*.txt files.
2021-06-10 00:27:52 -07:00
db388165a9
Bump pillow from 8.1.2 to 8.2.0 in /requirements ( #793 )
...
Bumps [pillow](https://github.com/python-pillow/Pillow ) from 8.1.2 to 8.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases )
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst )
- [Commits](https://github.com/python-pillow/Pillow/compare/8.1.2...8.2.0 )
---
updated-dependencies:
- dependency-name: pillow
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-08 13:27:17 -07:00
James R. Barlow
3d6907f7f6
v12.0.3 release notes
2021-05-27 13:53:33 -07:00
James R. Barlow
701c3b371b
docs: take a more vender neutral position on commercial OCR
2021-05-27 13:45:59 -07:00
James R. Barlow
684e5b4944
docs: mention ISO Latin-1
2021-05-27 13:42:17 -07:00
James R. Barlow
a964080f77
validation: a word
2021-05-27 13:42:05 -07:00
James R. Barlow
3f72f16958
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-05-27 01:26:40 -07:00
James R. Barlow
b4f2582766
Show ExitCodeException traceback in verbose mode
2021-05-27 01:26:25 -07:00
Frank and GitHub
c77cc7c837
Update README.md ( #785 )
...
readme: mention LinuxUser article
2021-05-26 12:37:58 -07:00
James R. Barlow
f3715daf15
Move HOCR_OK_LANGS to hocrtransform.py
2021-05-23 01:15:53 -07:00
James R. Barlow
c87221a4e6
validation: add proper list of languages supported by hocr
...
Based on Latin-1 support in default PDF fonts.
2021-05-23 01:14:15 -07:00
James R. Barlow
c409fa5825
v12.0.2 release notes
2021-05-18 23:22:11 -07:00
James R. Barlow
09c485bd88
Convert harmless Leptonica exception to warning
...
Closes Error when trying --remove-background on pdf #769
2021-05-18 23:19:51 -07:00
James R. Barlow
9d51a1b5ab
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-05-13 23:29:02 -07:00
James R. Barlow
43e7765efd
Expand documentation for adding language packs
...
Closes #777
2021-05-13 23:24:54 -07:00
Matthias Braun and GitHub
352f009c77
Fix code of French language pack in languages.rst ( #776 )
...
* Fix code of French language pack in languages.rst
* Update languages.rst
Reviewed-by: jbarlow83 <jbarlow83@users.noreply.github.com >
2021-05-09 01:03:13 -07:00
James R. Barlow
399b5548ca
v12.0.1 release notes
2021-04-26 01:18:57 -07:00
James R. Barlow
7b1e5b4f41
Fix "invalid version number" for untagged tesseract versions
...
Fixes #770
2021-04-26 01:18:07 -07:00
James R. Barlow
33e0b16174
v12.0.0 release notes
2021-04-23 00:04:21 -07:00
James R. Barlow
a613722e96
Auto-register semfree.py if needed
2021-04-21 23:39:38 -07:00
James R. Barlow
ad0126185f
Rename awslambda -> semfree.py
2021-04-21 23:29:55 -07:00
James R. Barlow
be45871d10
docker: add special hint for using docker
2021-04-21 23:18:29 -07:00
James R. Barlow
252221fd8b
dockerfile: remove unnecessary copy of /app/src
2021-04-21 23:17:42 -07:00
James R. Barlow
d25c49ba81
docs: remove incorrect value of rotate-pages-threshold from docs
...
Closes #762
2021-04-19 00:06:22 -07:00
James R. Barlow
5112e9e857
Redo dpi calc to avoid 'math.ulp'
2021-04-16 00:54:41 -07:00
James R. Barlow
757b72b0af
Revert "Remove apparently unused portion of a test"
...
This reverts commit d89a633ba7 .
2021-04-16 00:21:11 -07:00
James R. Barlow
75c5b92cb9
v12.0.0 update release notes
2021-04-15 23:49:58 -07:00
James R. Barlow
d673126994
Fix ZeroDivisionError on files containing images drawn at scale 0
...
Fixes #761
2021-04-15 23:26:14 -07:00
James R. Barlow
d89a633ba7
Remove apparently unused portion of a test
2021-04-15 23:25:18 -07:00
James R. Barlow
710d797299
Fix comment typos
2021-04-14 00:36:58 -07:00
James R. Barlow
fc75254c60
Fix awslambda progressbar.update() error
...
Fixes #759
2021-04-13 14:37:30 -07:00
James R. Barlow
f453e94f14
awslambda: better documentation
2021-04-13 13:16:35 -07:00
James R. Barlow
8f8aaa93ed
Refactor removing log handlers
2021-04-13 13:16:21 -07:00
James R. Barlow
a90b9e669f
Add reminder to not mess with pool/listener order
2021-04-09 13:22:48 -07:00
James R. Barlow
e4f69cc1d6
Maybe fix a deadlock on attempting sys.stderr.flush()
...
Closes #758
Closes #733
2021-04-09 01:59:30 -07:00
James R. Barlow
a5852ba199
Remove parent process's log handlers properly
2021-04-08 21:39:18 -07:00
James R. Barlow
051b9da991
Remove undocumented/unused debug environment variables
2021-04-08 21:08:12 -07:00
James R. Barlow
139d9f9841
Shut up pikepdf mmap disabled message
2021-04-08 20:58:46 -07:00
James R. Barlow
532d65a355
ci: push on tag
2021-04-08 14:19:59 -07:00
James R. Barlow
9de38afb13
Fix Tesseract version for ubuntu 18.04
2021-04-08 13:07:13 -07:00
James R. Barlow
913c939dc9
docs: update wrt AWS
2021-04-08 01:51:44 -07:00
James R. Barlow
9db9a3d6ec
helpers: improve test coverage of Resolution
2021-04-07 23:26:37 -07:00
James R. Barlow
8423bd549b
helpers: don't trap exception on failure to unlink
...
If we can't unlink a file we expect to unlink, logging and moving on is
probably the wrong action.
Coverage never hits this line.
2021-04-07 23:16:10 -07:00
James R. Barlow
336d274a54
Drop remnants of support for Tesseract without has_textonly_pdf
...
Also improve Tesseract version checking so it can compare all of their
weird conventions.
2021-04-07 23:05:21 -07:00
James R. Barlow
906d77b389
tests: remove obsolete running_in_travis()
2021-04-07 02:25:10 -07:00
James R. Barlow
9416e850ff
Remove another instance of helpers_namespace
2021-04-07 02:23:04 -07:00
James R. Barlow
fd3248869c
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-04-07 02:18:14 -07:00
James R. Barlow
2a09a668f6
Delinting: unused args
2021-04-07 02:18:08 -07:00
James R. Barlow
e788dde607
tests: eliminate unnecessary mmap
2021-04-07 02:11:31 -07:00
James R. Barlow
173a80864d
Delinting
2021-04-07 02:09:45 -07:00
James R. Barlow
aa115a8be3
Remove pytest_helpers_namespace
2021-04-07 01:56:51 -07:00
e0441c4aa1
Explicitly require setuptools, since pdfa.py imports pkg_resources ( #755 )
...
Co-authored-by: jbarlow83 <jbarlow83@users.noreply.github.com >
2021-04-06 02:23:44 -07:00
James R. Barlow
a861c58da2
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-04-06 02:07:16 -07:00
James R. Barlow
b1306bd7a8
tests: skip test_bash on Windows
2021-04-06 01:15:00 -07:00
James R. Barlow
3a6eb383dc
Run all tests
2021-04-06 00:28:06 -07:00
James R. Barlow
6c942ecefd
Update release notes
2021-04-06 00:17:36 -07:00
James R. Barlow
a25f8ecc62
Remove Azure Pipelines
2021-04-06 00:17:29 -07:00
andkrause and James R. Barlow
e1f4813d94
Dockerfile: support arm64
...
Thanks to @andkrause for submitting the initial PR that made this change
possible, @0x326 for review comments on the same PR, and both for their
patience in waiting for the rest of OCRmyPDF to catch up.
Co-authored-by: James R. Barlow
Closes #564
2021-04-06 00:09:04 -07:00
James R. Barlow
af526f078d
Activate codecov
2021-04-06 00:08:58 -07:00
James R. Barlow
16438c1312
Begin GitHub Actions migration
2021-04-06 00:08:13 -07:00
James R. Barlow
dd6cb7ce20
Preparing release notes
2021-04-02 01:10:53 -07:00
James R. Barlow
653e2e23df
Update deps for next release
2021-04-02 01:10:39 -07:00
James R. Barlow
a2033698fa
graft: use newer pikepdf style
2021-04-02 00:11:13 -07:00
James R. Barlow
ec1d585d40
Merge branch 'feature/misc-breaking'
2021-04-01 16:51:04 -07:00
James R. Barlow
a4e1f8e1f3
Merge branch 'feature/lambda'
2021-04-01 16:36:22 -07:00
James R. Barlow
2e155c31bf
Ensure builtin module registration is deterministic
2021-04-01 16:30:42 -07:00
James R. Barlow
e09ae9c68a
Fix test suite failure if filter_pdf_page is missing
2021-04-01 16:25:40 -07:00
James R. Barlow
c5bf1dd90d
reqs: bump reqs to avoid reportlab issue
2021-04-01 16:01:23 -07:00
e96770c5e4
Updated documentation for windows and additional languages ( #753 )
...
Changed the documentation for how to add new languages on Windows.
Co-authored-by: jbarlow83 <jbarlow83@users.noreply.github.com >
2021-03-26 16:13:28 -07:00
James R. Barlow
f4f0f3c022
v11.7.3 release notes
2021-03-20 23:30:42 -07:00
James R. Barlow
0a42934c08
Exclude Group 3 images from optimization
2021-03-20 23:28:21 -07:00
James R. Barlow
d8f47768f9
v11.7.2 release notes
2021-03-19 00:31:38 -07:00
James R. Barlow
c9594a4a5f
Update pinned versions to avoid Pillow vulnerabilties
...
See https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst
2021-03-19 00:31:27 -07:00
James R. Barlow
873f915212
docs: mention problems with Debian/Ubuntu and other tidying
2021-03-09 23:24:10 -08:00
James R. Barlow
079c162a96
Ensure sidecar is not input or output file
2021-03-05 00:29:42 -08:00
James R. Barlow
25c8c4656f
Fix error message change
2021-03-03 01:02:59 -08:00
James R. Barlow
ffcae9a1a0
v11.7.1 release notes
2021-03-03 00:46:35 -08:00
James R. Barlow
6e71fe1186
Clarify --unpaper-args errors
2021-03-03 00:44:21 -08:00
James R. Barlow
0885799010
Update docs for conda
...
Closes #743
2021-03-03 00:43:45 -08:00
James R. Barlow
8ffc99f648
optimize: log errors more loudly
2021-03-03 00:43:40 -08:00
James R. Barlow
2261c51eff
Reactivate pngquant on windows
2021-02-26 01:19:03 -08:00
James R. Barlow
5c470778a3
v11.7.0 release notes
2021-02-26 00:29:52 -08:00
James R. Barlow
4124889f36
Don't generate PDF/A-1b with object streams
...
Acrobat insists that PDF/A-1b should not have object streams.
Other programs like veraPDF disagree with this restriction, but
we can accommodate Acrobat so we will.
Also add more tests around this.
2021-02-26 00:23:57 -08:00
James R. Barlow
a23c22b0e8
helpers: tidy check_pdf
2021-02-25 22:51:53 -08:00
James R. Barlow
dd1f5f7215
pyproject: black doesn't like py39 yet
2021-02-25 16:10:20 -08:00
Dima Kuznetsov and GitHub
5e2206bae7
Allow --sidecar along --pages ( #735 )
2021-02-19 16:55:35 -08:00
James R. Barlow
079ee86d43
pyproject: also target py39
2021-02-18 01:48:56 -08:00
James R. Barlow
3692868004
v11.6.2 release notes
2021-02-15 01:48:14 -08:00
James R. Barlow
064f935699
Fix page rotation regression
...
Page size fixes in commit b26749 did accounted for a "kept" rotation,
but not a corrected rotation.
Fixes #730 .
2021-02-15 01:47:09 -08:00
James R. Barlow
8770fff968
tests: remove unreliable/incomplete test
2021-02-15 01:05:08 -08:00
James R. Barlow
82de78b6b0
v11.6.1 release notes
2021-02-14 01:51:26 -08:00
James R. Barlow
2a52c6dec2
optimize: skip images with unusually small dimensions
...
They're unlikely to be handled well by our recompressors. It seems
that JBIG2 cannot handle very small widths.
Fixes #732
2021-02-14 01:43:25 -08:00
James R. Barlow
2898879be7
docker-compose: fix typo
2021-02-14 01:43:06 -08:00
James R. Barlow
18e613657c
docker-compose: fix typo
2021-02-14 01:23:01 -08:00
James R. Barlow
a48ca556c7
Add filter_pdf_page hook
2021-02-14 01:22:33 -08:00
James R. Barlow
9cba738b48
Remove deprecated code
2021-01-31 19:27:59 -08:00
James R. Barlow
bccf2f423f
Stricter parameter checking for many public functions
2021-01-31 19:27:25 -08:00
James R. Barlow
390fdf8c05
Package OCR in Form XObject
...
Should improve results in some situations where the initial content
stream is messy or not well-formed.
2021-01-31 19:27:25 -08:00
James R. Barlow
166de3086b
Merge branch 'feature/colorstrategy'
2021-01-31 19:26:59 -08:00
James R. Barlow
206c675df6
docs: api
2021-01-31 19:26:35 -08:00
James R. Barlow
6c8f9223e9
Update awslambda to new pluginspec
2021-01-31 03:00:05 -08:00
James R. Barlow
85c6a974ca
Fix calls to hook.get_executor
2021-01-31 02:46:44 -08:00
James R. Barlow
dccdcfaa91
leptonica: tidy
2021-01-31 02:46:09 -08:00
James R. Barlow
b1da09f141
Add plugin for setting logging console
...
So that we are not tied to tqdm.
2021-01-31 02:29:11 -08:00
James R. Barlow
42c84531e4
optimize: rewrite JPEG optimize to avoid use of tqdm and parallelize
...
For some reason JPEG optimization was not done in parallel, and was
perhaps never done in parallel. Strange oversight.
2021-01-31 02:18:46 -08:00
James R. Barlow
a9ad805347
optimize: Remove shim for unsupported pikepdf version
2021-01-31 00:08:20 -08:00
James R. Barlow
16bda74974
Refactor - decouple progressbar from executor
2021-01-30 20:42:00 -08:00
James R. Barlow
d274d88929
Refactor to eliminate global state in _concurrent
2021-01-30 17:36:30 -08:00
James R. Barlow
327df5cbbc
Use ColorConversionStrategy "LeaveColorUnchanged"
...
Faster, still produces PDF/A
2021-01-26 15:44:41 -08:00
James R. Barlow
46d0632fe2
v11.6.0 release notes
2021-01-26 01:47:49 -08:00
James R. Barlow
ef1e7a814e
Delinting
2021-01-26 01:45:04 -08:00
James R. Barlow
1084724937
docs: improve API docs
2021-01-26 01:40:40 -08:00
James R. Barlow
ecb0109d79
docs: fix rst formatting error
2021-01-26 01:29:45 -08:00
James R. Barlow
386cabff00
Make progress pool common rather than plugin-specific
2021-01-24 23:56:09 -08:00
James R. Barlow
3bd5054634
lambda: move to extra_plugins folder
2021-01-24 23:47:26 -08:00
James R. Barlow
6a8dd65aa2
lambda: more issues related to new executor semantics
...
Now all tests pass, except for:
-tests that check the progress bar
-tests where xdist may or may not load a _lambda_plugin by running
some other test first before a test in optimize
2021-01-24 23:46:40 -08:00
James R. Barlow
6083b4f0a7
lambda: don't overrun number of workers needed
2021-01-24 23:46:40 -08:00
James R. Barlow
1a3ce59476
lambda: Don't be paranoid about exception marshalling
...
It works
2021-01-24 23:46:40 -08:00
James R. Barlow
c395436ba3
lambda: tidying, special casing use_threads
2021-01-24 23:46:40 -08:00
James R. Barlow
8d23d0b441
Operational lambda executor
2021-01-24 23:46:40 -08:00
James R. Barlow
c6a2716cdb
Temporary move into package
2021-01-24 23:46:40 -08:00
James R. Barlow
5545bae76f
lambda_plugin.py: doesn't work since entry point needs to be in package
2021-01-24 23:46:33 -08:00
James R. Barlow
7bccb8c748
tests: fix concurrency
2021-01-24 23:46:33 -08:00
James R. Barlow
173c0d1274
concurrency: lock progress pool
...
For API sanity and to communicate expectations. One progress pool at
a time is plenty of complexity.
2021-01-24 23:46:33 -08:00
James R. Barlow
6953f32465
pdfinfo: remove some messy concurrency handling
...
We can cut down on the use of global variables and save opening
an extra copy of the Pdf when threaded.
2021-01-24 23:46:33 -08:00
James R. Barlow
26b4d9bb4b
Refactor concurrency so that it is pluggable
...
However, this may not be the best idea because it involves global
state that could be overridden by a parallel call to ocrmypdf.ocr.
2021-01-24 23:46:29 -08:00
James R. Barlow
34e564cd7d
Use queue.Queue instead of multiprocessing.Queue in threaded mode
2021-01-24 23:45:26 -08:00
James R. Barlow
504d5776d2
Refactor plugin manager to eliminate callback
2021-01-24 23:42:40 -08:00
James R. Barlow
ee23976858
Re-sequence plugin installation
2021-01-24 23:42:28 -08:00
James R. Barlow
f559316881
Insert setuptools plugins with ocrmypdf prefix
2021-01-24 23:42:09 -08:00
James R. Barlow
084610c242
Automate insertion of builtin modules
2021-01-24 23:41:50 -08:00
James R. Barlow
9ff627472b
Update pre-commit
2021-01-24 23:40:59 -08:00
James R. Barlow
956310d1ec
Import PageContext, PdfContext since they are referenced in pluginspec
2021-01-24 02:04:47 -08:00
James R. Barlow
1a982da442
tests: confirm that we produce pdf when optimization is off
2021-01-24 01:54:25 -08:00
James R. Barlow
4879a1f0de
docs: no MS Store Python
2021-01-18 13:27:31 -08:00
James R. Barlow
ce66bcc9c8
github: Ask how ocrmypdf was installed
2021-01-10 02:35:24 -08:00
James R. Barlow
1ebf3144af
v11.5.0 release notes
2021-01-09 16:48:40 -08:00
James R. Barlow
7a1cccbc4e
Fallback to LeptonicaErrorTrap_Redirect if ffi.callback fails
...
Might fix issue #709 , Apple silicon support.
2021-01-09 16:47:11 -08:00
James R. Barlow
ebacff1b39
tests: Fix debug logging test
2021-01-09 16:41:57 -08:00
James R. Barlow
c7c447be66
Add test for configure_debug_logging
...
Since we can't directly test it
2021-01-09 16:02:12 -08:00
James R. Barlow
91aa175602
Consider text when determining page raster DPI
...
Previously if we found vectors of any sort on a page, we would bump
the DPI up to 400. We did nothing
about pages with text. As a result,
pages with a low image resolution
and printable text would have the text downgraded to image
resolution when --force-ocr was used.
We don't try to determine if the text is visible or invisible OCR text, since
that is a slower test. --redo-ocr would improve such cases anyway.
2021-01-09 16:01:49 -08:00
James R. Barlow
b267494e4a
Create raster PDF pages to match input page size
...
Previously we produced a raster image, then multiplied image width
by DPI to get the page size. However if there is rounding the
page size may not match exactly. In this modified approach we
constrain the page size to match.
2021-01-08 15:10:43 -08:00
James R. Barlow
f687180ecc
tests: tidy pdfinfo
2021-01-08 15:04:52 -08:00
James R. Barlow
6f4b38b103
ghostscript: tidy comments
2021-01-08 00:41:03 -08:00
James R. Barlow
d32324859c
v11.4.5 release notes
2021-01-06 11:42:28 -08:00
James R. Barlow
48222b87b5
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2021-01-06 03:59:40 -08:00
62e5edc72b
fix unclosed file warnings. ( #710 )
...
Co-authored-by: Jonas Winkler <jonas.winkler@jpwinkler.de >
2021-01-06 03:59:28 -08:00
James R. Barlow
2846d46bb8
Remove .coveragerc and fold into setup.cfg
2021-01-06 03:58:18 -08:00
James R. Barlow
47ef1914d4
v11.4.4 release notes
2021-01-01 01:39:24 -08:00
James R. Barlow
df157552f3
Make ocrmypdf.ocr take a threading lock
2021-01-01 01:37:09 -08:00
James R. Barlow
0b3a526049
Partial fix crash on 'userunit' None ( #700 )
...
Our method of getting data from pdfminer would silently consume a StopIteration
if pdfminer returned no processed pages, leading to odd error message.
We improve an error from pdfminer properly, and returning a more
descriptive error of our own.
It would be possible for ocrmypdf to repair the file before sending it to
pdfminer, but this seems to be rare enough that we won't do that yet.
2021-01-01 01:11:32 -08:00
James R. Barlow
1e80d412fa
tesseract: fix typing of some optional arguments
2021-01-01 00:46:00 -08:00
James R. Barlow
df6e106203
concurrent: simplify results loop
2021-01-01 00:44:46 -08:00
James R. Barlow
bd0f005861
tests: tag tests that need pngquant, jbig2enc
2020-12-30 01:58:57 -08:00
James R. Barlow
6ba4b7b3f3
ci: temporarily disable pngquant on Windows
...
Looks like a packaging error, choco complains of bad hashes.
2020-12-30 01:40:56 -08:00
James R. Barlow
2c11349ee8
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-12-29 21:40:46 -08:00
James R. Barlow
b0afef09ef
v11.4.3 release notes
2020-12-29 21:40:35 -08:00
James R. Barlow
72fa347c38
tests: skip metadata test for two pikepdf versions that warn incorrectly
2020-12-29 01:47:52 -08:00
James R. Barlow
96d68c2413
pipeline: refactor metadata_fixup
2020-12-29 01:47:32 -08:00
James R. Barlow
babc76fa74
tests: assert that most patched functions are called
...
We were not actually checking if functions we patched we called when
expected.
2020-12-28 23:58:33 -08:00
Tim Gates and GitHub
dc06990e5d
docs: fix simple typo, instsalled -> installed ( #704 )
...
There is a small typo in docs/installation.rst.
Should read `installed` rather than `instsalled`.
2020-12-28 15:28:34 -08:00
James R. Barlow
0ff0d2f8d1
Remove PDF/A overprint debug message
...
Since we currently log all of a process's output at debug it's
redundant to log this separate message.
2020-12-27 16:19:05 -08:00
James R. Barlow
81602cf420
Fix test not patching properly after Ghostscript polling change
2020-12-27 16:01:50 -08:00
James R. Barlow
607e2d7e81
v11.4.2 release notes
2020-12-27 03:29:35 -08:00
James R. Barlow
b01d9e07e8
Deal with missing pthread_sigmask on Cygwin
...
Closes #701
2020-12-27 02:24:00 -08:00
James R. Barlow
91db94cf2e
watcher: fix OCR_LOGLEVEL env var not processed
...
Closes #702
2020-12-27 02:02:44 -08:00
James R. Barlow
416df803d4
pdfinfo: stricter typing
2020-12-24 22:39:00 -08:00
James R. Barlow
037b96ca16
pdfinfo: refactor to eliminate RawPageInfo
2020-12-24 02:57:44 -08:00
James R. Barlow
bb258fc99c
pdfinfo: Refactor pageinfo dictionary into a class
2020-12-24 01:47:53 -08:00
James R. Barlow
4b8ccbe8cb
v11.4.1 release notes
2020-12-22 01:41:15 -08:00
James R. Barlow
ab1ff3331b
misc: synology fix
...
Accept user-contributed fix. Not testable.
Close #690 .
2020-12-22 01:38:41 -08:00
James R. Barlow
3675ae918c
Fix certain invalid page ranges causing exception
...
Closes #686
2020-12-22 01:22:14 -08:00
James R. Barlow
0ba32b96b7
Revert "v11.4.0 release notes - remove change not actually implemented"
...
This reverts commit ad202693b3 .
Temporary folder prefix was actually changed in commit f11bb53e .
2020-12-22 00:47:25 -08:00
James R. Barlow
add64e4fa2
docs: com.github.ocrmypdf -> ocrmypdf.io
2020-12-22 00:46:42 -08:00
James R. Barlow
7fe2954ede
Change wheel tag to py36, update package_data to include py.typed
2020-12-12 16:49:04 -08:00
James R. Barlow
ad202693b3
v11.4.0 release notes - remove change not actually implemented
...
Remove a change that was pushed back to a future release.
2020-12-12 16:27:38 -08:00
James R. Barlow
594ef83551
v11.4.0 release notes
2020-12-11 15:09:49 -08:00
James R. Barlow
78b71618c1
Fix BufferedReader TypeError
2020-12-11 14:19:20 -08:00
James R. Barlow
b8aa89e1ec
Fix log message queue flooding on certain files
...
Fixes #692
2020-12-11 14:14:21 -08:00
James R. Barlow
b4c1f66bc1
typing: tidy up
2020-12-11 14:14:21 -08:00
James R. Barlow
5172dbde8d
subprocess: use more mypy-friendly syntax
2020-12-11 14:14:21 -08:00
James R. Barlow
d2908640c6
pdfa: help mypy figure out a type
2020-12-11 14:14:21 -08:00
James R. Barlow
997bf7578d
hocrtransform: fix exception if no div ocr_page object
2020-12-11 14:14:21 -08:00
James R. Barlow
043258242c
hocrtransform: trivial typing
2020-12-11 14:14:21 -08:00
James R. Barlow
156d5d9a9c
cli: typing
2020-12-11 14:14:21 -08:00
James R. Barlow
0b7e52fb5e
api: parse cmdline in more type friendly way
2020-12-11 14:14:21 -08:00
James R. Barlow
a5feef07d0
Declare ocrmypdf as typed
2020-12-11 14:14:21 -08:00
James R. Barlow
f11bb53e61
Change prefix of temporary folders
...
Shouldn't really use a name that suggests a connection to GitHub.
2020-12-07 21:51:46 -08:00
James R. Barlow
68a57a7839
Add feature to generate hocr-pdf with visible debug text
2020-12-04 17:38:48 -08:00
James R. Barlow
4194430dc1
Begin next release notes
2020-12-04 13:28:04 -08:00
James R. Barlow
a707c56fae
docs: improve windows instructions
2020-12-04 13:21:54 -08:00
James R. Barlow
3cba50bfbd
windows: look in registry for Tesseract and Ghostscript
2020-12-04 13:21:54 -08:00
James R. Barlow
ed5e17d0a4
completions: consider *.PDF and some images too
2020-12-04 13:20:35 -08:00
James R. Barlow
ce0e0ecd4d
Decouple tqdm from progressbar setup
2020-12-04 13:20:28 -08:00
James R. Barlow
7e1223c12c
ghostscript: add output tracing
2020-11-29 14:53:35 -08:00
James R. Barlow
b83d7f6d1a
subprocess: refactor and add run_polling_stderr
2020-11-29 14:36:03 -08:00
James R. Barlow
80e957908a
tesseract: fix run call with logs_errors_to_stdout
2020-11-29 14:25:46 -08:00
James R. Barlow
f0e7bea8ba
docs: remove redundant statement
2020-11-27 13:54:36 -08:00
James R. Barlow
0cdb9bd04a
docs: remove description of how OMP_THREAD_LIMIT is managed
2020-11-23 12:36:04 -08:00
James R. Barlow
8224d89bc6
v11.3.4 release notes
2020-11-18 11:57:28 -08:00
James R. Barlow
a2bbbe2a26
v11.3.4 release notes
2020-11-18 11:56:29 -08:00
James R. Barlow
43f41863fa
check_pdf: document how we handle linearization
2020-11-18 11:54:07 -08:00
James R. Barlow
d71e50e83d
Fix "readLinearizationData for file that is not linearized"
...
pikepdf 2.1.0 throws wrong type of exception in this case, so special-case it.
Closes #680
Closes #681
2020-11-18 11:52:17 -08:00
James R. Barlow
1f598da3c1
ghostscript: better docs and comments
2020-11-18 11:34:17 -08:00
James R. Barlow
d0cdbd5e1c
watcher: include uppercase .PDF too
2020-11-12 02:29:47 -08:00
James R. Barlow
5c56f61209
unpaper: type hints
2020-11-11 02:59:37 -08:00
James R. Barlow
9bec85470a
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-11-10 04:08:05 -08:00
James R. Barlow
a03863a17d
docs: fix link to docker image
2020-11-10 04:08:01 -08:00
James R. Barlow
22cd9b2364
docs: fix csv-table errors
2020-11-10 04:07:49 -08:00
pretentious7 and GitHub
4fc7d6d93e
fix typo "charcter" -> "character" ( #673 )
2020-11-09 16:53:02 -08:00
James R. Barlow
71f0e7f545
v11.3.3 release notes
2020-11-07 00:53:33 -08:00
James R. Barlow
895fddd85e
Replace most uses of universal_newlines with text
...
The parameters are equivalent but the latter is better named. Since
Python 3.6 doesn't support text= we use our wrapper to add it in that
place.
This is for subprocess.run.
2020-11-07 00:48:08 -08:00
James R. Barlow
5a59e4d543
unpaper: don't use universal_newlines=True
...
There's no specific reason to do this. We can log binary output equally
well.
2020-11-07 00:18:27 -08:00
James R. Barlow
b51abf2249
azure: Fix indentation mistake
2020-11-04 12:19:35 -08:00
James R. Barlow
6d3f9ff15a
api: rework ocr() slightly to simplify variable handling
2020-11-03 17:10:52 -08:00
James R. Barlow
5d1d1a712b
docs: more details about macOS API changes
...
Due to fork->spawn
2020-11-03 17:09:58 -08:00
James R. Barlow
6d5f8133e0
docs: show ifmain guard in example
2020-11-03 15:28:33 -08:00
James R. Barlow
13018d3d5c
ci: Extend test matrix to Python 3.9
2020-11-03 04:15:14 -08:00
James R. Barlow
14a85f9473
Fix pinned dependencies
2020-11-03 04:12:47 -08:00
James R. Barlow
d22a1b3367
v11.3.2 release notes (2)
...
Since we never tagged it, fix other things.
2020-11-03 02:03:25 -08:00
James R. Barlow
b913e5dfef
ghostscript: don't repeat log in debug
...
Subprocess already does this for us.
2020-11-03 01:45:06 -08:00
James R. Barlow
dd8a5a4c72
Fix log domain names
...
ocrmypdf.subprocess.subprocess.ghostscript -> ocrmypdf.subprocess.ghostscript
2020-11-03 01:44:35 -08:00
James R. Barlow
36e9a54f02
Remove extraneous page rotation
...
This was added in commit b5ccbfd but seems to have been ill-advised.
2020-11-03 01:34:28 -08:00
James R. Barlow
3707af3b74
Change pdf.root to pdf.Root
2020-11-03 01:30:31 -08:00
James R. Barlow
ced7ad9164
unpaper: round off DPI
2020-11-03 01:14:57 -08:00
James R. Barlow
54bbbfdeb3
Fix UnboundLocalError when considering ImageMasks for optimization
...
Uncovered by test file in issue 667, although unrelated to that issue.
2020-11-03 01:08:14 -08:00
James R. Barlow
7f73a6ed1e
Some Python 3.9 fixes
2020-11-03 00:45:47 -08:00
James R. Barlow
dce206d3dc
Fix pre-commit for Py3.9
2020-11-03 00:20:25 -08:00
James R. Barlow
9304c856cf
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-11-02 02:47:36 -08:00
James R. Barlow
e5df98cbdf
v11.3.2 release notes
2020-11-02 02:43:32 -08:00
James R. Barlow
19bf3aeb00
api: improve typing
2020-11-02 02:33:34 -08:00
James R. Barlow
e86be0031c
unpaper: fix process output handling
...
With the ocrmypdf.subprocess wrapper, logging the output here
is redundant and loses the page number context.
2020-11-02 01:07:41 -08:00
James R. Barlow
6425977998
unpaper: use pnm instead of png
...
Some users reported problems with PNG recently; try PNM.
Fixes #665
Fixes #667
2020-11-02 01:05:56 -08:00
James R. Barlow
d57df2d980
subprocess: support programs that write their messages to stdout
2020-11-02 01:00:59 -08:00
James R. Barlow
664d0c7969
Document configure_debug_logging
2020-11-02 00:59:00 -08:00
James R. Barlow
a354663ee1
Fix typo in API documentation
2020-11-02 00:58:28 -08:00
Graham Miln and GitHub
b21b048ec4
Add macOS brew language support ( #615 )
...
Note `brew` command for installing additional languages on macOS.
2020-10-30 01:09:06 -07:00
James R. Barlow
709c65b41a
v11.3.1 release notes
2020-10-27 23:11:11 -07:00
James R. Barlow
67f99c5bb7
Endorse pdfminer.six 20201018
2020-10-27 23:09:45 -07:00
James R. Barlow
d55e673d9c
Fix warning about --pdfa-image-compression argument at wrong times
...
Closes #663
2020-10-27 23:09:45 -07:00
James R. Barlow
21b90d2d14
Endorse pikepdf 2.x
2020-10-27 23:09:45 -07:00
Edward Betts and GitHub
2def7e3392
Use % for percentage in string format ( #643 )
2020-10-27 23:09:14 -07:00
James R. Barlow
b0dcaa7512
v11.3.0 release notes
2020-10-24 03:19:32 -07:00
James R. Barlow
e8285b1d10
Add test to confirm rasterize_pdf_page rotates correct
2020-10-24 03:10:59 -07:00
James R. Barlow
5ba56adb53
Fix page rotation issue (again)
...
Commit 1327ab3 introduced a fix for a regression, which was reported
in #581 , #634 . It appears that the actual cause of this issue was
default parameters to rasterize_pdf_page in pluggy not working as
expected, causing a default rotation=0 even when a rotation was needed.
As such the OCR image was generated with the wrong orientation,
causing the initial regression and fix in commit 1327ab3 .
Now that the real problem is identified, it's apparent that the logic
prior to 1327ab3 was found and we can revert to 1327ab3 since it fixes
all known cases including #658 .
This reverts 1327ab3 except for retaining improves to rotation output.
2020-10-24 02:45:21 -07:00
James R. Barlow
ca735278e0
setup: Version pluggy better
2020-10-24 02:35:41 -07:00
James R. Barlow
b5ccbfdf25
Fix hookspec of rasterize_pdf_page to remove default parameters
2020-10-24 02:35:18 -07:00
James R. Barlow
8c35d6e6e4
Fix debug log messages being suppressed from child processes
2020-10-22 02:20:06 -07:00
James R. Barlow
d1e0c81eda
Ensure worker_pdf is closed after gathering info in a thread
...
This is hacky, uses global state, but it does improve the situation for now.
2020-10-22 00:38:24 -07:00
James R. Barlow
10c8e4f8b4
Only create debug.log when running from command line
...
When used as a library ocrmypdf shouldn't make policy decisions, like where to
put a log file. Unsurprisingly, creating it causes problems for library users
because we deleted the temporary folder which held the log file and made no
effort to move it to a new location.
Also update the documentation to better described how an application should
handle this.
Closes #657
2020-10-20 01:29:36 -07:00
James R. Barlow
6be2242c21
Describe "OCR" step as "Image processing" when --tesseract-timeout=0
...
Fixes #647
2020-10-08 01:03:42 -07:00
James R. Barlow
204c9d6ae1
Fix inverted colors during JBIG2 optimization on paletted images
...
Fixes #640
2020-10-07 04:08:50 -07:00
James R. Barlow
6eb393590b
v11.2.0 release notes
...
Change v11.1.3 to v11.2.0 since it contains functional changes.
2020-10-06 03:24:31 -07:00
James R. Barlow
07c6654057
v11.1.3 release notes
2020-10-06 03:22:48 -07:00
James R. Barlow
4e15eb8d14
Fix image optimization discarding image masks and soft masks associated with PNGs
...
Fixes #648
2020-10-06 03:20:54 -07:00
James R. Barlow
8b01ab8ad2
Better type checking on ocrmypdf.ocr(plugins=...)
2020-10-05 15:02:34 -07:00
James R. Barlow
e0a522ad50
Document the example plugin
2020-10-05 15:01:44 -07:00
James R. Barlow
a1a8788c5a
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-09-29 02:46:27 -07:00
James R. Barlow
cccdc178c3
v11.1.2 release notes
2020-09-29 02:46:18 -07:00
James R. Barlow
4eacb3454f
hOCR: write text in correct order
...
Fixes #642
2020-09-29 02:45:11 -07:00
Jimit Dholakia and GitHub
82b8b41e80
docs: Add 'unpaper' optional dependency for Ubuntu 18.04 ( #639 )
2020-09-25 11:54:31 -07:00
James R. Barlow
581c5020ab
v11.1.1 release notes
2020-09-25 00:28:38 -07:00
James R. Barlow
3ef8872a1e
pngquant driver: refactor, use streams instead of temporary files
2020-09-25 00:18:02 -07:00
James R. Barlow
28eec73eed
Tighten unpaper-args validation to exclude . and ..
...
Just in case
2020-09-25 00:18:02 -07:00
James R. Barlow
bfe4a5b329
Tidy a log message
2020-09-25 00:17:57 -07:00
James R. Barlow
29097837d6
Release notes typo
2020-09-19 00:49:36 -07:00
James R. Barlow
a40361db3c
Remove unpaper from macOS build
...
Homebrew seems to be having issues with its deps?
2020-09-17 03:38:48 -07:00
James R. Barlow
8b29e3cbab
Merge commit '9a6cd95e5fe2826d40861229aaa0431b76e302e7'
2020-09-17 03:34:35 -07:00
James R. Barlow
b170be120b
v11.1.0 release notes
2020-09-17 03:21:06 -07:00
Suyash Behera and GitHub
9a6cd95e5f
load zlib before liblept on windows ( #633 )
...
fixes #631
2020-09-17 03:14:42 -07:00
James R. Barlow
d464d3122e
Use img2pdf to create optimized PNG images
...
Fixes #629 , #620
2020-09-17 03:11:26 -07:00
James R. Barlow
1327ab37d4
Fix page rotation regression
...
Fixes #634 , #581
2020-09-17 02:57:00 -07:00
James R. Barlow
67553fc5c6
Display page numbers in log messages when grafting
2020-09-17 01:20:50 -07:00
James R. Barlow
306a903854
Remove unused function log_page_orientations
2020-09-17 01:20:02 -07:00
James R. Barlow
b93cf51c0f
Disable pikepdf mmap
...
Infrequently we can reproduce this error:
terminating with uncaught exception of type std::runtime_error: pybind11_object_dealloc(): Tried to deallocate unregistered instance!
The error is probably related to pybind11 issue #2252 and a bunch of
other related issues. Until that is resolved in pybind11 and pikepdf
we will disable the pikepdf mmap interface.
2020-09-16 23:48:55 -07:00
James R. Barlow
6b994221c6
Remove Python 3.7 from build since homebrew removed it
2020-09-16 23:44:18 -07:00
James R. Barlow
8b5b02e0d8
Expand documentation of filter_page_image
2020-09-14 14:36:17 -07:00
James R. Barlow
624df9bb23
Extend example plugin with example of mono conversion
2020-09-14 14:35:50 -07:00
James R. Barlow
fa06ea3600
v11.0.2 release notes
2020-09-08 02:38:57 -07:00
James R. Barlow
31994258fb
metadata fixup: don't try to update original PDF's metadata with docinfo
2020-09-08 02:35:16 -07:00
James R. Barlow
1f15ecbca5
Add "Postprocessing" message as a hint for long Ghostscript runs
2020-09-08 02:34:10 -07:00
James R. Barlow
bcf5657e5c
Reorganize issue templates
2020-08-26 17:11:52 -07:00
jbarlow83 and GitHub
2ae028bf38
Update issue templates
2020-08-26 17:03:09 -07:00
James R. Barlow
b51a5887e5
v11.0.1 release notes
2020-08-17 23:25:31 -07:00
James R. Barlow
fc523e837c
Clarify that the GPL-3 portion of pdfa.py was removed
...
Removal was in 8c90f7c97 .
pdfa.py now has no special licensing and falls unders the
"Files: *" clause of debian/copyright.
2020-08-17 23:23:31 -07:00
James R. Barlow
caeba76a61
Approve img2pdf 0.4 as it passes tests
2020-08-14 01:34:04 -07:00
James R. Barlow
cd35216f21
setup: blacklist pdfminer.six 20200720
...
NotAllowedError is going to removed
https://github.com/pdfminer/pdfminer.six/commit/99f0c09869370d74eb6a27234284b894c33414f4
2020-08-12 13:10:08 -07:00
James R. Barlow
e6a7b58863
Merge branch 'de-gpl'
2020-08-12 12:20:38 -07:00
James R. Barlow
56184a762f
Issue template:Give stronger hints about sample input files
2020-08-12 12:12:37 -07:00
James R. Barlow
07ab98f5af
docs: mention that Ghostscript PDF/A can swallow hyperlinks
...
Addresses #605
2020-08-12 12:12:00 -07:00
James R. Barlow
04fb1892b4
Don't ask for sample files anymore
2020-08-12 11:40:42 -07:00
James R. Barlow
173ce2f215
v10.3.3 release notes
2020-08-07 02:23:21 -07:00
James R. Barlow
9b641055e1
Fix KeyError: 'dpi' when using --threshold on image to PDF
...
Fixes #607
2020-08-07 02:21:02 -07:00
James R. Barlow
4fa28d7e74
v10.3.2 release notes
2020-08-05 01:36:56 -07:00
James R. Barlow
bed74501fc
Fix test breakage in validation
...
Broken in commit 4cc0dc
2020-08-05 01:35:26 -07:00
James R. Barlow
8c90f7c972
Replace GPLv3-derived PDF/A template with PostScript generator
2020-08-05 01:30:45 -07:00
James R. Barlow
aa0ec40102
Change license of all GPLv3 files to MPL-2.0
...
https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-05 00:44:42 -07:00
James R. Barlow
12c567ee10
Copyright cleanup: relicense example_plugin.py
...
The author is relicensing this file to MIT.
2020-08-05 00:15:33 -07:00
James R. Barlow
d39778ce3a
Clarify copyright status of misc/batch.py, synology.py
...
At the time these files were contributed there was no discussion
of the license that the authors wanted to use, but the project was
MIT licensed at the time. As such, these files deemed to be MIT licensed.
https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-05 00:12:44 -07:00
James R. Barlow
e824cdbc4e
Change license of misc/watcher.py to MIT
...
The authors of this file all agreed to relicense it under the MIT license.
https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-04 23:57:41 -07:00
James R. Barlow
1d91c09963
Clarify license status of misc/completion/* files
...
These files were contributed when the project license was GPLv3. On
discussion, all known authors of these files agreed to place them
under MIT license.
See https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-04 23:53:56 -07:00
James R. Barlow
e821ca46d5
Approve pdfminer.six 20200726
2020-08-03 16:04:16 -07:00
James R. Barlow
a29e4952fb
Document use of mmap
2020-08-03 16:03:54 -07:00
James R. Barlow
4cc0dc6b4a
Additional size increase reasons
2020-08-03 16:03:29 -07:00
James R. Barlow
7263702de9
Remove gs.py (spoofers entirely removed) and update copyright
2020-07-29 16:31:47 -07:00
James R. Barlow
0287d91874
v10.3.1 release notes
2020-07-26 21:53:08 -07:00
James R. Barlow
436af55050
Approve pdfminer.six 20200720
2020-07-26 21:51:49 -07:00
James R. Barlow
d6128e6937
Fix support for older versions of pdfminer.six (boxes_flow error)
2020-07-26 21:51:25 -07:00
James R. Barlow
642437e804
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-07-22 00:34:33 -07:00
James R. Barlow
4ce802fdb2
v10.3.0 release notes
2020-07-22 00:34:27 -07:00
James R. Barlow
a672422b0b
Enable pikepdf mmap in other contexts
2020-07-22 00:20:07 -07:00
James R. Barlow
addc2cbad0
Enable pikepdf mmap and set up signal handlers
2020-07-22 00:19:50 -07:00
James R. Barlow
5f45f77b4e
docs: plugins update
2020-07-21 23:53:30 -07:00
James R. Barlow
93f9bffb37
Merge branch 'feature/leptonica-179'
2020-07-20 21:23:53 -07:00
James R. Barlow
44149ad319
Disable test_error_trap for Leptonica < 1.79
...
Old error trap seems unreliable in the first place so difficult to set up
a test.
2020-07-20 21:12:00 -07:00
fcatus and GitHub
d80d963cea
pdfinfo: Replace list comp with gen expr'n
2020-07-20 02:21:58 -07:00
James R. Barlow
4da33b8050
Update debian/copyright from Debian, with fixes
2020-07-19 03:50:43 -07:00
James R. Barlow
5cbbff8472
For Leptonica 1.79+ use leptSetStderrHandler
...
Lock free and considerably less dangerous to stderr messages.
2020-07-19 03:40:33 -07:00
James R. Barlow
fa6e47c277
Merge branch 'feature/optimize-cleanup'
2020-07-19 01:53:11 -07:00
James R. Barlow
4ea9cffebd
Add locking to Leptonica error trap
...
To protect another thread from interfering with our redirection of
stderr.
2020-07-19 01:51:58 -07:00
James R. Barlow
ae68edefc5
pipelines: fix Python 3.7/3.8 on macOS
2020-07-19 01:51:58 -07:00
James R. Barlow
1558e068f1
docs: explain firstresult hook behavior
2020-07-16 00:01:59 -07:00
James R. Barlow
d2a9c413f8
docs: install notes for ARM64
2020-07-14 01:25:16 -07:00
James R. Barlow
a510b21b20
optimize: add typing for Xref, remove fspath()'s
2020-07-09 14:06:41 -07:00
James R. Barlow
e33ba07aa4
Update pre-commit settings
2020-07-08 23:45:53 -07:00
James R. Barlow
373f27832b
optimize: improve typing of xref_exts
2020-07-07 22:41:29 -07:00
James R. Barlow
b20a6e4c5d
optimize: add type hints
2020-07-07 22:18:50 -07:00
James R. Barlow
49734d5456
optimize: fix incorrect to prevent re-optimizing JBIG2s
2020-07-07 21:52:11 -07:00
James R. Barlow
26a415c5dd
docs: Note usage of OCR_JSON_SETTINGS for watcher
2020-07-07 21:26:57 -07:00
James R. Barlow
60be64a5f1
Fix debug.log missing pageno handler
2020-07-04 03:59:38 -07:00
James R. Barlow
190294634c
docs: edit plugins
2020-07-03 16:16:01 -07:00
James R. Barlow
1722cb579d
v10.2.1 release notes
2020-07-01 03:26:57 -07:00
James R. Barlow
dc42beb6a8
More typing improvements
...
Typing fixes bugs.
2020-06-30 15:02:30 -07:00
James R. Barlow
378f543619
TextPositionTracker: set boxes_flow=None
...
We don't care about the order of lines in our analysis, and this is an
expensive calculation in pdfminer.
2020-06-30 04:20:58 -07:00
James R. Barlow
62924ee280
Improve API documentation
2020-06-30 04:20:14 -07:00
James R. Barlow
86a73191b0
Plugin manager: accept Path(plugin)
2020-06-30 04:17:30 -07:00
James R. Barlow
86875997b8
Fix more mypy errors
2020-06-29 02:17:14 -07:00
James R. Barlow
b939584c7a
quality: fixing typing issues
2020-06-29 01:45:45 -07:00
James R. Barlow
bbd174071d
readme: markdown cleanup
2020-06-29 01:45:27 -07:00
James R. Barlow
e5b6fe1317
pyproject.toml: weird line wrapping?
2020-06-29 01:45:12 -07:00
James R. Barlow
f15d9049eb
install: add Mageia
...
Closes #586 . Thanks to @yannick56
2020-06-26 23:28:26 -07:00
James R. Barlow
7630c93e5b
install: drop Ubuntu 14.04 steps
...
Bit rot must have set in.
2020-06-26 23:27:42 -07:00
James R. Barlow
638d68aa8a
docs: move Windows ahead of FreeBSD
2020-06-26 22:49:34 -07:00
James R. Barlow
a92dde058a
docs: promote one liner installs, reorg Windows
2020-06-26 22:47:44 -07:00
James R. Barlow
580f2ebb4b
Python 3.9beta is now known to work (Fedora)
2020-06-26 00:06:58 -07:00
James R. Barlow
01cae7a584
docs: Update Fedora versions
2020-06-23 02:08:24 -07:00
James R. Barlow
66337813e6
Spell runslow correctly
2020-06-22 23:32:09 -07:00
James R. Barlow
eb5a211e72
New hocrtransform test isn't platform stable - mark runslow
2020-06-22 16:59:59 -07:00
James R. Barlow
5142933120
v10.2.0 release notes
...
Closes #582 , #584 , #545
2020-06-22 16:37:51 -07:00
James R. Barlow
06ab114aa8
Update test cache
2020-06-22 16:31:34 -07:00
James R. Barlow
1257419465
test_hocrtransform: this test is worth not caching
2020-06-22 16:31:06 -07:00
James R. Barlow
30404f53f0
Add test to sanity check our pdf renderers
2020-06-22 16:18:38 -07:00
James R. Barlow
1ce8edbdfe
hocrtransform: some text not included in output after Tesseract changes
2020-06-22 15:48:23 -07:00
James R. Barlow
d4b704a0ae
hocrtransform: refactor colors
2020-06-22 15:22:48 -07:00
James R. Barlow
2d64e1536d
hocrtransform: refactor xpath manipulations
2020-06-22 14:44:34 -07:00
James R. Barlow
c8b581ac31
hoctransform: remove deprecated element.getchildren()
...
Breaks Python 3.9.
2020-06-22 14:28:18 -07:00
James R. Barlow
ad8dead7df
Document that API accepts streams now
2020-06-22 14:27:27 -07:00
James R. Barlow
c9bd87254e
A few minor typing issues
2020-06-22 02:31:53 -07:00
James R. Barlow and James R. Barlow
f4cb424451
Support input/output streams at API level
2020-06-22 02:02:18 -07:00
James R. Barlow
fef14778d5
Fix missing f-string in log message
2020-06-22 01:17:16 -07:00
James R. Barlow
86ec63f215
Decouple plugin manager forking from PdfContext/Pagecontext
2020-06-22 01:16:59 -07:00
James R. Barlow
5b10ec9d39
jobcontext.PdfContext: remove dead code, add annotations
2020-06-22 00:34:58 -07:00
James R. Barlow
800c75c4e5
Bump requirements (mainly for Docker's benefit)
2020-06-21 01:58:53 -07:00
James R. Barlow
24d64b04c3
Update Docker to Ubuntu 20.04 and jbig2-latest
2020-06-21 01:48:31 -07:00
James R. Barlow
48e2750551
Fix some tests that were failing in Docker
2020-06-21 01:48:13 -07:00
James R. Barlow
e182c5f63e
Update and sync .dockerignore, .gitignore
...
Also blacklist .* and whitelist the ones we want.
2020-06-21 01:25:59 -07:00
James R. Barlow
06d52326db
Fix deleted path in .coveragerc
2020-06-21 01:24:23 -07:00
James R. Barlow
ebfe4f0d29
Fix issue #582 - PDF/A acquires title "Untitled" after conversion
2020-06-20 02:01:16 -07:00
James R. Barlow
ad22977c84
v10.1.1 release notes
2020-06-17 14:45:32 -07:00
James R. Barlow
6ac50646f0
Fix OMP_THREAD_LIMIT rounded down to 0 in some cases
2020-06-17 14:43:19 -07:00
James R. Barlow
24b6a4ad50
v10.1.0 notes
2020-06-16 00:55:28 -07:00
James R. Barlow
e802896d4d
unpaper: use PNG input where possible
...
Unpaper accepts PNG as input now, so avoid generating a huge
temporary PPM file if we can. If we
must create a PNG, compress it lightly to keep our temp usage down.
2020-06-16 00:50:18 -07:00
James R. Barlow
0b5a20e593
coverage: ignore type checking
2020-06-15 15:55:39 -07:00
James R. Barlow
642998ead6
sync: refactor preprocess image filtering
2020-06-15 15:26:41 -07:00
James R. Barlow
698aab4f75
Add a lot of type annotations
2020-06-15 15:20:50 -07:00
James R. Barlow
34231ac667
sync: refactor intermediate image production
2020-06-15 15:02:28 -07:00
James R. Barlow
ddedf7cd2e
For --clean-final, use same image as --clean if possible
2020-06-15 13:48:49 -07:00
James R. Barlow
9d127d354c
docs: improve description of plugins
2020-06-15 12:51:49 -07:00
James R. Barlow
2d2a4894ab
Some corrections to release notes
2020-06-15 12:51:28 -07:00
James R. Barlow
862861e3ca
Fix error message in logging from repeated filtering
...
If logging somehow triggers PageNumberFilter multiple times, it would fail on the second occurrence.
2020-06-13 14:50:58 -07:00
James R. Barlow
892db88f0e
test_two_languages: use narrower test
2020-06-12 14:33:02 -07:00
James R. Barlow
eeb44f78cc
Fix tests that failed on other platforms from previous fix
2020-06-12 12:59:46 -07:00
James R. Barlow
863835f660
v10.0.1 release notes
2020-06-12 12:11:21 -07:00
James R. Barlow
393c5a9ea4
Fix error on -l lang1+lang2
2020-06-12 12:10:29 -07:00
James R. Barlow
c6b9a49cbb
Fix tests that fail in CI
2020-06-10 17:08:00 -07:00
James R. Barlow
17a4831745
v10 release notes and dependencies
2020-06-10 14:27:47 -07:00
James R. Barlow
7caf1e85ff
info: change "Scan" message
2020-06-10 12:11:37 -07:00
James R. Barlow
f59a757e8b
info: tidy handling of content streams
2020-06-10 12:09:24 -07:00
James R. Barlow
872bafad4b
Reinstate quick test for text/no text
...
Partial revert of commit 991db17
2020-06-10 12:00:52 -07:00
James R. Barlow
8599400445
Only do page analysis on pages we will do OCR on
2020-06-10 11:33:27 -07:00
James R. Barlow
b6eebadf05
Use pikepdf.open with block to manage PdfInfo
2020-06-10 11:32:46 -07:00
James R. Barlow
a4e88eb8f0
Simplify plugin_manager pickling
2020-06-10 00:41:19 -07:00
James R. Barlow
f6257c2183
subprocess: lru_cache version checks
2020-06-10 00:32:06 -07:00
James R. Barlow
64891c2fc3
Pre-release delinting
2020-06-09 15:27:14 -07:00
James R. Barlow
fe156db41d
Merge branch 'release/v10' into trialmerge
2020-06-09 15:12:56 -07:00
James R. Barlow
0f942fb714
Rename ocrmypdf.exec -> ocrmypdf._exec
2020-06-09 14:59:09 -07:00
James R. Barlow
be8ca589d4
Move ocrmypdf.exec.run and friends to ocrmypdf.subprocess
2020-06-09 14:53:10 -07:00
James R. Barlow
3b6f6782f0
Remove tesseract_env, --tesseract-env
2020-06-09 00:39:53 -07:00
James R. Barlow
21c0e045cb
Remove _OCRMYPDF_TEST_PATH environment variable
2020-06-09 00:30:13 -07:00
James R. Barlow
ebbf68bd08
The big payoff: abolishing spoofing machinery
2020-06-09 00:08:20 -07:00
James R. Barlow
2059e916da
Convert all ghostscript spoofs to test plugins
2020-06-09 00:00:25 -07:00
James R. Barlow
c22f245606
Plugins must return not-None if they intend to stop builtin
2020-06-08 23:48:45 -07:00
James R. Barlow
7b9025f397
Convert generate_pdfa to plugin
2020-06-08 22:28:38 -07:00
James R. Barlow
b109445215
Move Ghostscript rasterize_pdf to plugin
2020-06-08 17:10:27 -07:00
James R. Barlow
fd1cd8e50a
docs: explain --rotate-pages-threshold
2020-06-08 07:46:55 -07:00
James R. Barlow
c6c70c2171
docs: Ubuntu 20.04 install instructions
2020-06-08 07:42:13 -07:00
James R. Barlow
a9a473f2e5
Convert all tesseract cache usages to plugin
2020-06-05 17:55:18 -07:00
James R. Barlow
6268e2faff
Begin replacing tests/spoof/tesseract_cache with plugin
2020-06-05 17:27:10 -07:00
James R. Barlow
ec3f506500
Convert tesseract_badutf8 to plugin
2020-06-05 16:38:19 -07:00
James R. Barlow
00daa51a73
v9.8.2 release notes
2020-06-03 13:28:35 -07:00
James R. Barlow
e60f4d3f43
docs: tidy Cygwin install
2020-06-03 13:27:05 -07:00
James R. Barlow
7460745f80
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-06-03 13:25:12 -07:00
James R. Barlow
5e14d5b0dd
Fix test_report_file_size
...
Use more realistic test data
2020-06-03 13:24:55 -07:00
James R. Barlow
d118132fa6
layout: look for text in XObjects too
2020-06-03 13:16:55 -07:00
5f47aac36f
Add installation instructions for Windows/Cygwin64 ( #571 )
...
Co-authored-by: Jim Garrison <bitbucket@jhmg.net >
2020-06-03 13:16:23 -07:00
James R. Barlow
c6b2fa8851
Remove unpaper spoof; no plugin needed
2020-06-02 02:42:14 -07:00
James R. Barlow
1b92f447c3
Convert tesseract_crash to plugin
2020-06-02 02:36:41 -07:00
James R. Barlow
82e7eb91d2
Tidy tesseract_noop
2020-06-02 01:50:02 -07:00
James R. Barlow
4f4ad0fb76
Convert tesseract_big_image_error to plugin
2020-06-02 01:49:47 -07:00
James R. Barlow
1d0b8641a0
Improve file size increase warning to account for changes to small files
...
Fixes #569
2020-06-02 00:35:59 -07:00
James R. Barlow
daca919775
Mark pdfminer.six 20200517 as supported
2020-06-02 00:11:02 -07:00
James R. Barlow
1598f2f0e5
Abolish spoof_tesseract_noop
2020-06-01 03:07:53 -07:00
James R. Barlow
2b23f7ec73
tesseract_noop: begin implementing with plugin
2020-06-01 02:45:49 -07:00
James R. Barlow
6528234608
Fix tesseract_ocr.py errors
2020-06-01 02:27:27 -07:00
James R. Barlow
642ebc6098
Fix test that failed on Windows
2020-05-28 15:52:00 -07:00
James R. Barlow
74fdfeea3f
v9.8.1 notes
2020-05-28 15:04:23 -07:00
James R. Barlow
3754185f56
Mark pdfminer.six 20200517 as supported
2020-05-28 15:01:51 -07:00
James R. Barlow
df9f5157bd
Fix shim_paths to account for unexpected files in Program Files\gs
...
Fixes #565
2020-05-28 14:58:41 -07:00
James R. Barlow
aa060db5bc
Refactor tesseract_env variable into the plugin
...
Removed all cases except one in api.py, which isn't worth solving because
it should be removed anyway.
This also fixes a logic error in the OMP_THREAD_LIMIT decision, api.py
did not use pass kwargs correctly so they never worked before.
2020-05-26 02:14:06 -07:00
James R. Barlow
d43212d30b
Refactor --language argument into set
2020-05-25 03:20:10 -07:00
James R. Barlow
a0f9ca3a30
Move Tesseract options validation into plugin
2020-05-25 01:31:46 -07:00
James R. Barlow
0cefe886ec
Update email
2020-05-19 16:12:36 -07:00
James R. Barlow
f656c00f41
docs: Note about OCRmyPDF speed
2020-05-18 01:27:45 -07:00
James R. Barlow
03da34ee24
Test files needed!
2020-05-16 17:04:44 -07:00
James R. Barlow
9bccff4f88
Move Tesseract specific arguments to plugin
2020-05-16 03:24:31 -07:00
James R. Barlow
2bd586e093
Compare requested languages to OCR engine instead of tesseract directly
...
Also refactoring to facilitating validation needing the plugin manager.
2020-05-16 01:50:37 -07:00
James R. Barlow
9af94ac9b7
pipeline: use OCR engine abstraction instead of Tesseract
2020-05-16 01:28:56 -07:00
James R. Barlow
8174089c8b
Begin transforming Tesseract into pluggable OCR engine
2020-05-14 03:54:21 -07:00
James R. Barlow
41eb54cc0a
Standardize tesseract.generate_hocr and _pdf parameters
2020-05-14 03:23:25 -07:00
James R. Barlow
12a2f78c4d
Fix validation of languages not using tesseract_env
...
And some related issues.
2020-05-14 03:19:22 -07:00
James R. Barlow
d372f1f7fa
Remove "skip page" from tesseract interface
...
Breaks tests/test_main.py::test_tesseract_missing_tessdata because
conftest.py does not update options.tesseract_env before testing options
for some reason, and tesseract.has_textonly_pdf raises an exception
instead of returning False as the test assumes.
2020-05-12 04:09:42 -07:00
James R. Barlow
6f5b75bcd0
Remove lru_cache on get_version
...
Does not play well with forking.
2020-05-12 03:51:48 -07:00
James R. Barlow
a2d3e0b53e
Convert remaining imports to absolute
2020-05-12 02:12:08 -07:00
James R. Barlow
7f67556995
ocrmypdf.__init__: Hide _HookimplMarker
2020-05-12 01:35:45 -07:00
James R. Barlow
db8c37e58c
Refactor ocrmypdf.exec.__init__.py
2020-05-12 01:34:10 -07:00
James R. Barlow
a87c81a64f
helpers: remove unnecessary isinstance test
2020-05-12 01:28:50 -07:00
James R. Barlow
4b986a5943
cli: make ArgumentParser._api_mode private
2020-05-12 01:28:36 -07:00
James R. Barlow
2fae9b655e
Remove **kwargs from check_external_program; deprecated
2020-05-12 01:07:01 -07:00
James R. Barlow
2541f6cf89
Fix missing jbig2enc reported as error with -O3 instead of warning
...
Fixes #558
2020-05-12 01:05:57 -07:00
James R. Barlow
33b68454f3
watcher: cleanup getenv casting
2020-05-08 03:49:49 -07:00
James R. Barlow
977665d2b6
Delint some tests
2020-05-08 03:49:33 -07:00
James R. Barlow
fd7497f00d
Remove old function tesseract.v4()
2020-05-08 03:44:39 -07:00
James R. Barlow
790ff58f67
Add fix for bug in Windows Python 3.6/3.7
...
TypeError: argument of type 'WindowsPath' is not iterable
2020-05-07 22:19:21 -07:00
James R. Barlow
4b98ce391b
docs: rename security->pdfsecurity so github won't misinterpret it
2020-05-07 03:54:27 -07:00
James R. Barlow
417dbd43f6
docs: plugin documentation
2020-05-07 03:53:37 -07:00
James R. Barlow
7a12908db9
Relocate example plugin
2020-05-07 03:27:39 -07:00
James R. Barlow
9462f0a28f
graft: more refactoring
2020-05-07 02:59:24 -07:00
James R. Barlow
e760622a5c
graft: refactor
2020-05-07 02:03:42 -07:00
James R. Barlow
1b086f60a9
tesseract.py: api cleanup
2020-05-06 12:37:44 -07:00
James R. Barlow
85cbf94a6e
Convert many uses of str paths to Path
2020-05-06 02:53:47 -07:00
James R. Barlow
6f4286e1b1
New hook: filter_page_image
2020-05-06 02:24:07 -07:00
James R. Barlow
39888ae8c9
Rename install_cli to add_options
2020-05-06 01:10:09 -07:00
James R. Barlow
dd361ecd05
Support importing plugin by filename
2020-05-06 00:44:40 -07:00
James R. Barlow
32759c9025
Change argument from --plugins to --plugin
2020-05-06 00:43:40 -07:00
James R. Barlow
59440448ee
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-05-04 01:38:26 -07:00
Peter Hogg and GitHub
51b54893ce
docs: update Arch Linux install instructions ( #540 )
...
The python-pdfminer.six package is now available in the official Arch
repositories. The dependency will be automatically resolved when
installing the OCRmyPDF AUR package.
2020-05-04 01:37:58 -07:00
James R. Barlow
1f3665f614
docs: remove reference to brewfile
2020-05-03 16:10:26 -07:00
James R. Barlow
75c34b873a
optimize: convert from executor to progress pool
2020-05-03 02:04:57 -07:00
James R. Barlow
fe4296c53b
safe_symlink: remove deprecated params
2020-05-03 00:53:47 -07:00
James R. Barlow
c85278b31d
Delinting
2020-05-03 00:53:29 -07:00
James R. Barlow
5dbc080fa0
Rename PDFContext->PdfContext
2020-05-02 04:32:46 -07:00
James R. Barlow
e02f6c1e97
Support plugin invocation with API
2020-05-02 03:34:31 -07:00
James R. Barlow
8c9a8fc85c
pluginspec: avoid circular reference
2020-05-02 03:32:55 -07:00
James R. Barlow
23d558ad8c
Allow plugins to add command line arguments
2020-05-02 01:37:24 -07:00
James R. Barlow
be107b4fed
Set up filter_ocr_image hook
2020-05-01 02:56:41 -07:00
James R. Barlow
8d2535e327
Get pluggy to work with forking workers
2020-05-01 02:39:50 -07:00
James R. Barlow
5eb4fe0052
Refactor plugin setup to get_plugin_manager
2020-05-01 02:18:31 -07:00
James R. Barlow
d8ff4485f8
Move samefile to helpers
2020-05-01 02:18:11 -07:00
James R. Barlow
82bce463ae
Start pluggy-based plugin system
2020-05-01 02:15:23 -07:00
James R. Barlow
016dfd420c
Add warning if problematic --tesseract-pagesegmode is selected
...
Fixes #549
2020-04-30 04:12:11 -07:00
James R. Barlow
b59e761a14
v9.8.0 release notes
2020-04-28 02:40:17 -07:00
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
b840b16c82
Remove tesseract_badutf8.py
...
Should have been removed in 9db01c7
2020-04-28 02:35:23 -07:00
James R. Barlow
8f5c95f0f4
Remove last vestiges of command line usage of qpdf - change to check_pdf
2020-04-26 05:33:26 -07:00
James R. Barlow
168fc60774
Update release notes with v10 changes
2020-04-26 05:14:59 -07:00
James R. Barlow
c84d0f606d
ghostscript: remove deprecated argument from generate_pdfa
2020-04-26 05:11:11 -07:00
James R. Barlow
8b54ce338f
setup: remove deprecated message about removeal of --force parameter
2020-04-26 05:09:42 -07:00
James R. Barlow
18c4aa10bf
Adjust number of workers for concurrent page scanning
2020-04-26 04:21:15 -07:00
James R. Barlow
991db17fde
Remove Ghostscript-based text extraction
...
While faster than Python based methods, we've outgrown the limited
amount of information Ghostscript provides with this feature, and it
repeats an analysis we have to do anyway to learn what images are
present.
2020-04-26 04:02:07 -07:00
James R. Barlow
2c07515907
macOS - use spawn for multiprocessing
...
See bpo-33725. This is the default for 3.8, opt-in for 3.7 and older.
2020-04-26 03:49:40 -07:00
James R. Barlow
27a3b80376
Use once-per-worker pikepdf init
2020-04-26 03:49:20 -07:00
James R. Barlow
8c381a0227
Replace task_initargs with use of partial()
2020-04-26 03:49:20 -07:00
James R. Barlow
86145a8c76
Some wrong with forking worker_pdf, just open it once per page for now
2020-04-26 03:49:20 -07:00
James R. Barlow
7513f5425c
Fix some broken tests
2020-04-26 03:49:20 -07:00
James R. Barlow
af3c3c6466
Further refactoring of concurrency concerns
2020-04-26 03:49:20 -07:00
James R. Barlow
db3e75e33e
Refactor multiprocessing pool
2020-04-26 03:49:13 -07:00
James R. Barlow
ce49fc26dd
Do pikepdf.open() once instead of per worker
2020-04-26 03:42:13 -07:00
James R. Barlow
d0d0a98dca
First cut at concurrent page scan
...
Improvement appears on 168 page file. Needs refactoring
2020-04-26 03:42:13 -07:00
James R. Barlow
3834d1a0bf
azure: use brew python instead
2020-04-26 00:58:38 -07:00
James R. Barlow
33e982b3fd
azure: add certifi, openssl for macOS
2020-04-26 00:37:14 -07:00
James R. Barlow
43d650e78c
Fix issue where only first PNG-style image would be optimized
2020-04-25 03:50:11 -07:00
James R. Barlow
b4c65c5781
Update requirements
2020-04-25 03:49:34 -07:00
James R. Barlow
d96867e6ab
watcher: add polling and log level adjustment
2020-04-24 04:14:44 -07:00
James R. Barlow
0a5108e704
install: clarify that old ocrmypdf should be removed from Ubuntu 18.04
...
Closes #526
2020-04-24 04:14:19 -07:00
James R. Barlow
94c52a6fa3
Refactor 'xyres' into Resolution
2020-04-24 04:12:05 -07:00
James R. Barlow
57771f06a3
Refactor xy-pair for resolution to tuple
2020-04-16 15:38:33 -07:00
James R. Barlow
58abb5785c
pytest picky about list vs tuple
2020-04-15 03:16:51 -07:00
James R. Barlow
509e75eaff
v9.7.2 release notes
2020-04-15 02:56:46 -07:00
James R. Barlow
0c50eedb2a
Support pdfminer.six 20200402
2020-04-15 02:55:22 -07:00
James R. Barlow
4581027246
Drop support for pdfminer.six 20181108
...
This version required a patch that has since been mainlined, and also did not
declare its dependency on chardet
correctly. We can remove both hacks now.
2020-04-15 02:50:36 -07:00
James R. Barlow
31b5f63f85
hocrtransform: cleanup/PEP8
...
Some API breaking changes.
2020-04-15 02:48:56 -07:00
James R. Barlow
957fb1494e
pytest picky about list vs tuple
2020-04-15 02:26:20 -07:00
James R. Barlow
9e3e4f2687
Improve help text about aborting due to text
2020-04-15 02:17:55 -07:00
James R. Barlow
2155bcacb4
Loosen test language requirements - eng/deu
2020-04-15 00:30:38 -07:00
James R. Barlow
346da95899
Suppress loglevel since we have color now
2020-04-15 00:09:36 -07:00
James R. Barlow
f4f7946a0c
Add colored logs
2020-04-15 00:05:38 -07:00
James R. Barlow
c2919f2e1c
Reinstate logging of page numbers
2020-04-15 00:05:23 -07:00
James R. Barlow
a63d624052
Improve logging of subprocess output
2020-04-15 00:04:43 -07:00
James R. Barlow
af91489376
Remove safe_symlink log= warning
2020-04-14 23:59:33 -07:00
James R. Barlow
d146d2b65c
The Great Logging Refactor
...
Remove all instances of logger object being passed as parameters.
This was a holdover from ruffus, and complicated a lot of simple things.
2020-04-14 23:59:33 -07:00
James R. Barlow
4ff4ed24a8
Refactor Windows executable shims
2020-04-14 23:59:33 -07:00
James R. Barlow
c38ff90081
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-04-14 23:55:01 -07:00
James R. Barlow
4c029e973f
Fix isinstance(..,str)
2020-04-14 23:53:52 -07:00
Lars K.W. Gohlke and GitHub
21cf9029e8
docs: Set ownership when using docker image ( #518 )
2020-04-14 23:32:01 -07:00
James R. Barlow
4a640b8dcd
Fix language argument not working as list
...
Fixes #523
2020-04-14 23:18:52 -07:00
James R. Barlow
9471bc8921
Fix versions with leading v, e.g. v5.0
2020-04-10 13:42:33 -07:00
James R. Barlow
7fe06c64fc
v9.7.1 release notes
2020-04-10 13:00:19 -07:00
James R. Barlow
d13d70fd56
Fix version checker failing for qpdf 10.0.0
...
Fixes #527
2020-04-10 13:00:19 -07:00
James R. Barlow
58ec56180a
Add a few more type annotations to public APIs
2020-04-10 13:00:19 -07:00
James R. Barlow
32a88f1bad
docs: warn that AWS Lambda doesn't work
2020-04-10 13:00:19 -07:00
James R. Barlow
99ef42940c
docs: warn that Windows users should use an ifmain guard
2020-04-10 13:00:19 -07:00
jbarlow83 and GitHub
c152710617
Update issue templates
2020-04-04 15:41:53 -07:00
James R. Barlow
8de0f9b86f
v9.7.0 release notes
2020-03-29 22:45:25 -07:00
James R. Barlow
23bc3d3a29
tests: workaround for Ghostscript 9.52 txtwrite problem
2020-03-29 22:45:16 -07:00
James R. Barlow
8307832ce9
tests: add force OCR to a file with text that Ghostscript doesn't see
...
For gs 9.52 support.
Also refactor use of pikepdf.open() to use with blocks.
2020-03-29 22:44:27 -07:00
James R. Barlow
dd1cf567db
watcher: Fix JSONDecodeError if OCR_JSON_SETTINGS not set
...
Fixes #516
2020-03-29 21:58:37 -07:00
James R. Barlow
2490be8490
Fix debug.log not being deleted on Windows (probably)
...
Fixes #515
2020-03-29 21:53:56 -07:00
James R. Barlow
85e6c6669a
docs: Add username to WSL instructions
...
Fixes #519
2020-03-29 21:16:24 -07:00
James R. Barlow
00498282f5
validation: blacklist Ghostscript 9.51 too
2020-03-24 21:27:18 -07:00
James R. Barlow
e4cc9fcba7
Wrong number of threads to use shown when OMP_THREAD_LIMIT is defined
2020-03-23 01:06:55 -07:00
James R. Barlow
a4555b1dae
Add halftone mask to leptonica
2020-03-18 23:09:39 -07:00
James R. Barlow
f35a2303bb
info.py: linearize O(n^2) search for use images on a page
2020-03-18 22:59:18 -07:00
James R. Barlow
82142fe5ef
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-03-16 04:11:03 -07:00
James R. Barlow
9be533b5f4
watcher: allow all parameters to ocrmypdf.pdf to be passed by JSON
2020-03-15 21:45:51 -07:00
James R. Barlow
99653fcd32
optimize: consider ICCBased 1 bit for optimization
2020-03-15 02:20:44 -07:00
James R. Barlow
5442c97ed8
Consult ICC profile when determining image colorspace
2020-03-11 04:03:09 -07:00
tlwhitec and GitHub
0165255bd9
fix install instructions for Ubunti 16.04 ( #507 )
...
`pip3` defaults to the system's outdated version which downloads wrong qpdf package.
2020-03-11 02:57:37 -07:00
James R. Barlow
378e4dae3b
Expand documentation for subprocess.run() from test
2020-03-04 13:37:44 -08:00
James R. Barlow
cdf5afa753
reqs: update pikepdf version
2020-03-03 11:56:10 -08:00
James R. Barlow
a2deee4920
v9.6.1 release notes
2020-03-03 03:40:33 -08:00
James R. Barlow
1efa79cce2
Remove potentially non-free file logo.afdesign
2020-03-03 03:40:33 -08:00
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
e429c3d729
docs: install cleanup
2020-03-03 03:25:43 -08:00
James R. Barlow
8308b20096
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-03-03 02:25:58 -08:00
James R. Barlow
8b41f60b6e
docs: docker prefers .yml not .yaml
2020-03-03 02:25:21 -08:00
Alex and GitHub
d56f749017
Improve ocrmypdf.bash completions on macOS ( #504 )
...
Fixes #502
2020-03-03 02:22:01 -08:00
James R. Barlow
9f31774aa9
docs: document --pages
2020-03-03 02:15:48 -08:00
James R. Barlow
7d55f6e01f
docs: extract example files from batch.rst
2020-03-03 02:15:35 -08:00
James R. Barlow
c3bd2f296d
docs: fix Docker syntax to use stdin/stdout properly
2020-03-03 02:14:50 -08:00
James R. Barlow
e40c60d4d8
watcher: add self to copyright
2020-03-03 00:59:57 -08:00
James R. Barlow
3960232ae0
docs: more clarifications
2020-03-03 00:59:48 -08:00
James R. Barlow
5fbb3fc6ac
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-03-01 23:05:10 -08:00
deisi and GitHub
0b1db8fccd
Fixes docker-compose.yaml file ( #499 )
...
Fixes https://github.com/jbarlow83/OCRmyPDF/issues/498
2020-03-01 23:01:39 -08:00
James R. Barlow
0417610f9b
docs: some mild improvements
2020-02-25 22:23:58 -08:00
James R. Barlow
43a23e3695
Disable Travis
2020-02-25 22:22:57 -08:00
James R. Barlow
c4ca572afd
Merge branch 'pigmonkey-aur-manual'
2020-02-25 22:21:35 -08:00
Pig Monkey
e04e4565a9
Demonstrate installing the AUR package without a helper
...
This describes how to use the AUR package on a minimal install, as per
the discussion in #494 .
There may be formatting mistakes. I don't use RST myself, so I wrote the
instructions in Markdown, converted via Pandoc, and gave the output a
quick comparison against the rest of the installation docs.
2020-02-25 18:59:49 -08:00
knobix and GitHub
2391fb0be0
Update installation instructions for FreeBSD ( #493 )
...
Python 3.7 is the new default version since 2020Q1 which is reflected in
the new prefix (= py37-).
Also update the current available FreeBSD versions:
* FreeBSD 11.2-RELEASE has reached its End-of-Life in 2019Q4
* FreeBSD 12.1-RELEASE was also introduced in 2019Q4
2020-02-24 23:40:25 -08:00
James R. Barlow
c16f79d51b
docs: add Docker compose configuration for watchdog
2020-02-18 02:50:57 -08:00
James R. Barlow
e3e888efde
Readme: Add another heise article
2020-02-18 02:41:28 -08:00
James R. Barlow
84f7e34ace
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-02-18 02:11:40 -08:00
Ivan Kuchin and GitHub
32e2175891
Docker image includes also French, Portuguese and Spanish ( #491 )
2020-02-18 02:10:01 -08:00
James R. Barlow
975abfde9a
docs: archlinux install - yaourt is gone
2020-02-18 02:08:58 -08:00
James R. Barlow
d929ed76c2
docs: typo
2020-02-12 00:07:24 -08:00
James R. Barlow
4a27124eab
Simplify metadata for invalid xml in output
...
Removes possibly non-free resource enron1.pdf.
2020-02-12 00:07:18 -08:00
James R. Barlow
683ffb84e8
Update reqs
2020-02-10 01:20:33 -08:00
James R. Barlow
2f2602357b
v9.6.0 notes updated
2020-02-10 01:20:12 -08:00
James R. Barlow
a5f429f499
Merge branch 'pr479'
2020-02-10 01:10:30 -08:00
James R. Barlow
bdb7f92131
ifmain -> main()
2020-02-10 01:10:12 -08:00
James R. Barlow
09f15ac4c0
v9.6.0 notes
2020-02-10 01:01:49 -08:00
James R. Barlow
4fdbf55c11
setup: approve pdfminer.six 20200124
2020-02-09 23:50:56 -08:00
James R. Barlow
fe2b07652b
docs: simplify/fix Ubuntu 18.04 install instructions
2020-02-09 23:48:53 -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
a005d14f91
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2020-01-30 16:24:16 -08:00
Matthias Braun and GitHub
6f66232d44
Fix typos, add instructions for training data ( #477 )
2020-01-30 16:24:41 -08:00
James R. Barlow
b8a780d684
Wait for file based on pikepdf
2020-01-30 12:40:48 -08:00
James R. Barlow
82f393dd09
Order of events
2020-01-30 12:40:19 -08:00
James R. Barlow
4952af1604
watcher: some refactoring
2020-01-28 12:56:19 -08:00
James R. Barlow
bcf77375c0
Fix grammar in output message
2020-01-28 07:33:28 -08:00
Ian Alexander
3eab161771
Update logging and env var extensibility
2020-01-20 10:45:28 -08:00
Ian Alexander
b7f38e976b
Watched folder bug fixes, new flags, and docs updates.
2020-01-20 00:20:29 -08:00
James R. Barlow
a6567f2ae4
v9.5.0 release notes revised
2020-01-18 01:48:33 -08:00
James R. Barlow
e860c56b75
Fix regression: metadata updates not taking effect
2020-01-17 23:01:37 -08:00
James R. Barlow
2e15d52895
v9.5.0 release notes
2020-01-17 03:11:33 -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
61a2674317
Skip test that needs chmod when on Windows
2020-01-06 02:36:04 -08:00
James R. Barlow
9ad8cbf1f6
Fix assert that depends on POSIX-y file handling
2020-01-06 02:02:05 -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
fd991a2380
Allow pdfminer.six 20200104 and update recommended versions
2020-01-05 21:37:28 -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
5169ac633b
docs: mention pdfgrep too
2020-01-05 21:32:36 -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
8f984bf958
docs: add note on limitations of sidecar file
2020-01-04 16:43:13 -08:00
James R. Barlow
9c5f0d0ec6
Eliminate last use of PyPDF2 from test suite
2020-01-04 16:32:01 -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
1037d73efb
tests: use smaller files for ghostscript
2019-12-31 17:20:28 -08:00
James R. Barlow
aeb7b142a9
tests: skip tests not compatible with coverage
...
For reasons not entirely clear, stdout will get some data injected when
pytest-cov is running. Our tests that
check for clean stdout need to ignore this.
We check for an environment variable that is defined only when coverage is
running.
2019-12-31 17:10:51 -08:00
James R. Barlow
422ea9777e
Remove session scope from fixtures
...
pytest seems to prepare os.environ in complex ways, so we want to ensure
these fixtures are not reused.
2019-12-31 17:09:23 -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
96ee21aee9
Try to set up subprocess coverage better
2019-12-31 15:39:45 -08:00
James R. Barlow
4b759af6ff
tests: fix problems with ghostscript spoofers
2019-12-31 15:33:03 -08:00
James R. Barlow
25d2b0cda4
test: environment warnings/cleanup
2019-12-30 22:38:50 -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
054c0773a3
Update completions
2019-12-29 02:40:55 -08:00
James R. Barlow
89aa78b724
docs: fix obsolete statement to "brew install tesseract-lang"
...
Closes #469
2019-12-29 02:37: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
95ef5410c2
azure: tweak windows script
2019-12-28 16:12:53 -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
045bdff95a
azure: homebrew broke something to do with python@2?
2019-12-28 16:10:43 -08:00
James R. Barlow
d12b27ac1d
v9.3.0 release notes
2019-12-28 15:42:24 -08:00
James R. Barlow
e4e00de79f
Add improved example demonstrating watched folder functionality
...
Closes #466
2019-12-28 15:37:42 -08:00
James R. Barlow
a53a3937c2
Fix exception on parsing Ghostscript error messages
2019-12-20 11:25:45 -08:00
James R. Barlow
343424b4d2
azure: only publish code coverage for macOS
...
macOS (due to Homebrew) currently has the most comprehensive code
coverage. Azure's code coverage feature does not merge code coverage,
so last task to finish wins.
2019-12-20 10:56:10 -08:00
James R. Barlow
c5edff2c2f
Sort imports
2019-12-19 15:31:18 -08:00
James R. Barlow
8c5f8b8ddd
Add isort to precommit
2019-12-19 15:29:38 -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
facc4750bc
Remove command line qpdf from azure and travis
2019-12-12 00:14:05 -08:00
James R. Barlow
437c235738
v9.2.0 release notes and docs
2019-12-11 13:13:51 -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
9af59c0d6d
docs: improvements for Windows
2019-12-09 21:39:01 -08:00
James R. Barlow
55ae838cb7
azure: fix extra build step
2019-12-09 21:11:50 -08:00
James R. Barlow
c434b97f55
docs: more install notes
2019-12-09 16:18:01 -08:00
James R. Barlow
607eee198d
tests: split out preprocessing tests
2019-12-09 16:18:01 -08:00
James R. Barlow
5e2a7f8a56
tests: speed up several slow tests
2019-12-09 16:17:57 -08:00
James R. Barlow
fd9550acda
Add Azure Pipelines CI/CD
2019-12-09 16:17:33 -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
7be293f628
Address tests that fail on Windows with Python 3.7 or 3.6
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
17d97b354a
Ignore mypy cache
2019-12-06 15:11:10 -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
66bda3420a
docs: cause about using Windows in production
2019-12-06 15:03:20 -08:00
James R. Barlow
f6510e2b15
Document function of symlink shim
2019-12-06 15:00:12 -08:00
James R. Barlow
51abd79136
Tesseract no longer posts an error message if config file not found
2019-12-04 21:35:28 -08:00
James R. Barlow
5607429d9a
tests: error message from tesseract change
2019-12-04 21:31:01 -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
d4abe88452
docs: sketch Windows install procedure
2019-12-04 21:01:09 -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
cff37bf681
Make test_german more Windows-friendly
2019-12-04 21:01:09 -08:00
James R. Barlow
66d04dd6e3
Don't expect filenames to be replicated on NT
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
ca9669742d
Move gs tests to test_ghostscript
2019-12-04 17:14:27 -08:00
James R. Barlow
8a1dddc3ee
Don't worry about closed streams on Windows
2019-12-04 17:14:27 -08:00
James R. Barlow
0cd424ffcb
Enforce str-only environment for Windows since it's more strict
2019-12-04 17:14:27 -08:00
James R. Barlow
fde550f9a7
test: Replace many instances of run_ocrmypdf in subprocess with inline
2019-12-04 17:14:27 -08:00
James R. Barlow
a3726e4ce3
Fix test_metadata: use mmap in a Windows and POSIX compatible way
2019-12-04 17:13:52 -08:00
James R. Barlow
4ab0a8ff35
Fix test_single_page_inline_image - remove temp file
2019-12-04 17:13:51 -08:00
James R. Barlow
37f6f72df3
tests: a few Windows fixes
2019-12-04 17:13:51 -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
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
17d20309c7
leptonica: fix missing Leptonica error message for Windows
...
Since it has the unintuitive fix of adding Tesseract to PATH.
2019-12-04 17:13:51 -08:00
James R. Barlow
fe7c69ce95
leptonica: don't open files by name; use memory buffers
...
Avoids encoding issues and makes error trap unnecessary in some cases.
2019-12-04 17:13:51 -08:00
James R. Barlow
9baccee8c5
leptonica: Handle API change for pixFindPageForeground
2019-12-04 17:13:51 -08:00
James R. Barlow
d5bb9929f3
leptonica: Use Windows name for DLL
...
Thanks to @dibu28
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
17c419dfcb
compile_leptonica: move to correct location
2019-12-04 17:04:08 -08:00
James R. Barlow
84cc49b14b
black: don't reformat _leptonica.py
2019-12-04 17:04:08 -08:00
James R. Barlow
b7f63bc93d
Make devnull check compatible with Windows
2019-12-04 17:04:08 -08:00
James R. Barlow
ad9a3b5302
Update version of pdfminer.six supported
2019-12-04 17:04:08 -08:00
James R. Barlow
4e4bcaf243
Improve pre-commit checks
2019-11-25 14:38:23 -08:00
James R. Barlow
11afe3507f
black: don't reformat _leptonica.py
2019-11-25 14:34:36 -08:00
James R. Barlow
7691ba8535
v9.1.1 release notes
2019-11-18 15:17:00 -08:00
James R. Barlow
b787a369ee
Fix reference to Alpine apk add
2019-11-18 15:13:42 -08:00
James R. Barlow
9fb8b267af
docker: use get-pip to install pip
...
Smaller download, needed for manylinux2010.
2019-11-16 15:21:45 -08:00
James R. Barlow
0a08d6ce1f
Update version of pdfminer.six supported
2019-11-13 01:45:06 -08:00
James R. Barlow
f517efe819
docs: wsl - get-pip.py
2019-11-12 15:01:15 -08:00
James R. Barlow
5f5421f23d
test: further fixes to test_report_file_size
2019-11-12 01:14:21 -08:00
James R. Barlow
703b6db95c
test: fix test_report_file_size
2019-11-11 23:00:08 -08:00
James R. Barlow
000040d497
v9.1.0 release notes
2019-11-11 22:39:33 -08:00
James R. Barlow
5bd6665b49
Use pikepdf 1.7.0 to improve Python 3.8 support
2019-11-11 22:36:38 -08:00
James R. Barlow
1c303afe21
docs: fix installation instructions for pikepdf manylinux2010 wheels
2019-11-11 22:22:30 -08:00
James R. Barlow
11a5c80917
travis: enable Py 3.8
2019-11-11 22:19:15 -08:00
James R. Barlow
9b2ab92913
tesseract: fix exception when logger is RootLogger
2019-11-11 22:19:01 -08:00
James R. Barlow
0c4b69ec5a
Fix lint warning about missing cur_item
2019-11-09 14:56:43 -08:00
James R. Barlow
45bea1c0e0
Import and docstring cleanup
2019-11-09 14:56:30 -08:00
James R. Barlow
db914d4cd1
Report missing optional dependencies as possible cause of file size increase
2019-11-09 14:21:57 -08:00
James R. Barlow
df4a8faecd
docs: mention systemd for batches
2019-11-08 03:24:54 -08:00
James R. Barlow
1273e7aeda
docs: document optimization
2019-11-08 03:22:28 -08:00
James R. Barlow
e13a673b1a
docs: mention how to suppress progbar
2019-11-08 02:59:02 -08:00
James R. Barlow
979b0bcaed
tesseract: refactor logging
2019-11-05 15:38:09 -08:00
James R. Barlow
3438afaffe
Support pdfminer.six 20191020
2019-11-04 03:15:59 -08:00
James R. Barlow
681fa039cc
Update release notes; disable Py3.8 test again
2019-11-04 03:00:15 -08:00
James R. Barlow
69e80f1545
docker-compose.test does not seem to be ready for production use
2019-11-04 02:58:57 -08:00
James R. Barlow
983835cce4
docs: add remark about optimizing without OCR
2019-11-04 02:32:29 -08:00
James R. Barlow
6c23b137e2
Docker: relocate dockerfile
2019-11-04 02:27:30 -08:00
James R. Barlow
d656b2b3f2
docs: remove comment about Ubuntu image
...
[ci skip]
2019-11-04 02:08:42 -08:00
James R. Barlow
031b800aac
Docker autotest: fix, maybe?
2019-11-04 02:04:07 -08:00
James R. Barlow
05eb85ee77
Docker: try adding automated test
2019-11-04 01:23:54 -08:00
James R. Barlow
4da5214ca9
Drop support for unpaper 6.1 on Ubuntu 14.04
2019-11-04 00:09:04 -08:00
James R. Barlow
1ee829dd59
Travis: enable Python 3.8 testing
2019-11-04 00:05:18 -08:00
James R. Barlow
99db5d91ae
Fix issue "MANIFEST.in exists" by removing MANIFEST.in
...
MANIFEST.in is always an issue
2019-11-04 00:03:49 -08:00
James R. Barlow
3a4490ee36
Dockerfile: fix jbig2 not copied over
2019-11-03 23:52:08 -08:00
James R. Barlow
a492e3b472
Dockerfile: fix errors are trying to build unneeded cached wheels
2019-11-03 23:51:55 -08:00
James R. Barlow
c3719d3b72
Dockerfile: remove venv from Ubuntu image; tweak reqs
2019-11-03 23:39:40 -08:00
James R. Barlow
ad48fc6415
Remove Alpine Docker image
2019-11-03 22:35:15 -08:00
James R. Barlow
7f8018ffde
Mention that v9.0.4 requires a source install for Py3.8 for now, due to lack of CI availability
2019-11-03 01:49:36 -08:00
James R. Barlow
80651fe12c
Fix test suite error
2019-10-24 18:17:03 -07:00
James R. Barlow
a58209e895
Disable Py3.8 for now
2019-10-24 18:16:47 -07:00
James R. Barlow
775b958c55
Update release notes
2019-10-24 16:58:39 -07:00
James R. Barlow
cdcdd16865
Require Pillow 6.2.0 based on security vulnerability report in older versions
2019-10-23 12:27:29 -07:00
James R. Barlow
b332d76782
Mention when we default to English and the system locale is not English
...
Closes #337
2019-10-22 01:49:38 -07:00
James R. Barlow
3660007fc8
travis: Python 3.8, osx_image
2019-10-20 04:06:13 -07:00
James R. Barlow
b55d7e57af
Python 3.8 updates
2019-10-20 03:20:54 -07: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
78e8bf9cbf
Use at most 3 Tesseract threads
...
Based on a user suggestion and
tesseract-ocr/tesseract#2611 , I reviewed thread limits and found that
thread limit of 3 is still beneficial, but not 4.
> time env OMP_THREAD_LIMIT=2 tesseract omp4.png stdout >/dev/null
Warning: Invalid resolution 0 dpi. Using 70 instead.
Estimating resolution as 143
116.67user 1.67system 1:26.26elapsed 137%CPU (0avgtext+0avgdata 356752maxresident)k
2213inputs+0outputs (18major+131059minor)pagefaults 0swaps
> time env OMP_THREAD_LIMIT=3 tesseract omp4.png stdout >/dev/null
Warning: Invalid resolution 0 dpi. Using 70 instead.
Estimating resolution as 143
136.89user 1.63system 1:19.56elapsed 174%CPU (0avgtext+0avgdata 356784maxresident)k
821inputs+0outputs (0major+131080minor)pagefaults 0swaps
> time env OMP_THREAD_LIMIT=4 tesseract omp4.png stdout >/dev/null
Warning: Invalid resolution 0 dpi. Using 70 instead.
Estimating resolution as 143
161.31user 1.51system 1:18.80elapsed 206%CPU (0avgtext+0avgdata 356632maxresident)k
8477inputs+0outputs (12major+131074minor)pagefaults 0swaps
> time env OMP_THREAD_LIMIT=8 tesseract omp4.png stdout >/dev/null
Warning: Invalid resolution 0 dpi. Using 70 instead.
Estimating resolution as 143
160.30user 1.62system 1:18.01elapsed 207%CPU (0avgtext+0avgdata 356640maxresident)k
821inputs+0outputs (0major+131078minor)pagefaults 0swaps
2019-09-20 17:12:36 -07:00
James R. Barlow
de61530d4d
docs: fix intermediate file list for v9
2019-09-20 17:02:35 -07:00
James R. Barlow
c149f860b5
Add contributing guide
2019-09-20 17:02:22 -07:00
James R. Barlow
68c852acec
Remove test_tesseract_config_invalid from suite
...
Also causes problems in CI
2019-09-18 13:28:02 -07:00
James R. Barlow
a8565bac6e
Fix any False in the ocrmypdf.ocr() API being set to True
2019-09-15 01:47:31 -07:00
James R. Barlow
6e8b0c3194
Fix py36 test including 37
2019-09-15 01:47:10 -07:00
James R. Barlow
ff860e8362
Fix black settings in pyproject.toml
2019-09-15 01:46:13 -07:00
James R. Barlow
cf4b04c5d1
optimize: work around pikepdf 1.6.3 limitation with indexed ICCbased colorspaces
2019-09-11 12:56:27 -07:00
James R. Barlow
078bc2abe9
pdfa: assume 3 RGB channels always
2019-09-11 12:55:38 -07:00
James R. Barlow
d7b7ca0574
v9.0.3 notes; Remove test_tesseract_config_notfound from suite
2019-09-05 13:39:43 -07:00
James R. Barlow
17ac9d7a9a
Embed ICC profile in .ps (fixing Ghostscript 9.28 compatibility)
...
Previously we included the
filename, which required Postscript to run with file access enabled. For
security, Ghostscript 9.28 enables ``-dSAFER`` and as such, no longer
permits access to any file by default. This fix is necessary for
compatibility with Ghostscript 9.28.
We use ASCII85 for a slightly more compact representation.
2019-09-05 13:17:26 -07:00
James R. Barlow
a2a197ce4c
v9.0.2 release notes
2019-09-04 02:34:21 -07:00
James R. Barlow
944d59e5ad
Fix --print-parameters issue when chi_sim is not installed
2019-09-04 01:17:52 -07:00
James R. Barlow
1c3e90a892
optimize: solve monochrome by converting to G4
2019-09-04 00:51:47 -07:00
James R. Barlow
c728836956
Adjust test requirements
2019-09-04 00:50:48 -07:00
James R. Barlow
0d80fab339
Remove restriction on pytest < 5
2019-09-03 23:47:55 -07:00
James R. Barlow
a650caa599
optimize: don't consider 1bpp images for PNG optimization
2019-09-03 23:47:20 -07:00
James R. Barlow
c6caff90a1
optimize: only re-insert pngs after pngquant
...
Previously we attempted to reinsert all PNGs, but it appears to be
unlikely that Leptonica's API is actually capable of optimizing the PNG
before it inserts it.
In any event qpdf has gained image optimization capabilities as well
which we coudld borrow.
2019-09-03 23:46:25 -07:00
James R. Barlow
671c88d3b5
optimize: exclude images with custom Decode tables
2019-09-03 23:37:23 -07:00
James R. Barlow
b2cfaedf91
optimize: Don't reinsert 1bpp images
...
There seems to be version to version inconsistencies between
Leptonica's photometric interpretation of 1bpp images, in
particular commit a0692307 introduces a change to force transcoding
in this situation.
However, I never entirely got to the bottom of where the problem
is, and in any event 1bpp images are probably better optimized
by JBIG2 than pngquant, so we're going to stop running them through
pngquant.
2019-09-03 23:26:13 -07:00
James R. Barlow
19ba3ae011
Allow test_german to xfail if deu language is not installed
2019-09-03 17:38:54 -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
c8d6ea6b10
Fix tests broken by --print-parameters change
2019-09-03 17:17:24 -07:00
James R. Barlow
b0d9775343
Attempt to resolve black-inversion issue
2019-08-31 01:25:36 -07:00
James R. Barlow
462bfb84fb
install: affirm that we now require Tesseract beta
2019-08-31 01:24:31 -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
638eb556ef
Reactivate user-words test that was always skipped
2019-08-27 14:52:59 -07:00
James R. Barlow
fdefcd8af2
travis: Make 3.7 the build leader/deployer
2019-08-26 13:30:07 -07:00
James R. Barlow
09457edad3
alpine: use jbig2enc@community
2019-08-26 12:49:47 -07:00
James R. Barlow
6460a7eb3e
docs: leptonica.com -> .org
2019-08-26 12:07:34 -07:00
James R. Barlow
707ebeb151
docs: installation updates
2019-08-11 18:48:56 -07:00
James R. Barlow
e9bc093842
v9.0.1 release notes
2019-08-11 17:14:11 -07:00
James R. Barlow
2eeaca1168
travis: make minimal config even more minimal
2019-08-11 17:13:55 -07:00
James R. Barlow
7755c5c5a7
tests: fix interpretation of None as omitted argument
2019-08-11 16:58:22 -07:00
James R. Barlow
793348a47c
tests: mark test as requiring pngquant
2019-08-11 16:58:22 -07:00
James R. Barlow
b241f66919
travis: Add a minimal Ubuntu config
2019-08-11 16:58:06 -07:00
James R. Barlow
8ad034a678
docs: update install on FreeBSD to point to ports
2019-08-11 15:50:52 -07:00
James R. Barlow
a1a7b973e9
tests: split out stdin/stdout tests
2019-08-09 01:23:49 -07:00
James R. Barlow
7bfcd0a9d5
Use pikepdf 1.6.1
2019-08-09 01:12:13 -07:00
James R. Barlow
f276c4ef1e
Alpine Docker: jbig2enc moved from testing to community
2019-08-09 01:09:18 -07:00
James R. Barlow
77bbc22c50
Ensure --image-dpi on non-image produces a warning
2019-08-09 01:08:16 -07:00
James R. Barlow
a6805ed343
Travis: remove vestiges of pdfminer being optional on osx
2019-07-30 00:42:38 -07:00
James R. Barlow
c4afc5c242
Add missing item from v9.0.0 release notes
2019-07-30 00:39:14 -07:00
James R. Barlow
df32008667
Ensure test_optimize passes
...
Linearization sends it over the edge
2019-07-27 16:47:53 -07:00
James R. Barlow
db4598f76a
Add PDF linearization
2019-07-27 16:15:48 -07:00
James R. Barlow
ce13431ecf
Remove experimental filters.py
2019-07-27 15:47:09 -07:00
James R. Barlow
eb104b405d
Avoid circular imports for __version__
2019-07-27 05:02:19 -07:00
James R. Barlow
5f00e4f9d8
Sort imports
2019-07-27 04:51:52 -07:00
James R. Barlow
1a91cd4652
pikepdf 1.6
2019-07-27 04:36:48 -07:00
James R. Barlow
b0f1a55537
completions: --pages
2019-07-27 04:26:38 -07:00
James R. Barlow
0c066d1d53
Expand scope of --pages testing
2019-07-27 04:26:23 -07:00
James R. Barlow
e4cfcec5f3
docs: some cleanup
2019-07-27 04:04:33 -07:00
James R. Barlow
85c90404d7
Update release notes
2019-07-27 03:23:56 -07:00
James R. Barlow
4d011c28ea
Improve completions
2019-07-27 03:02:04 -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
6fbeb6347d
Merge api (without plugins)
2019-07-27 02:04:01 -07:00
James R. Barlow
f83de20c37
Remove plugins (for now)
...
It's holding up too many other useful,
releaseable changes.
2019-07-27 01:41:14 -07:00
James R. Barlow
423324af01
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2019-07-15 12:08:59 -07:00
James R. Barlow
016a2a01d9
docs: Notes on WSL
2019-07-13 02:06:11 -07:00
James R. Barlow
6189910c74
Fix text-image registration when mediabox contains an offset
...
Cropbox, trimbox not addressed... should look at those. Also rotation.
2019-07-11 02:20:04 -07:00
James R. Barlow
7117dc10de
Suppress noisy empty debug messages
2019-07-11 01:23:01 -07:00
jbarlow83 and GitHub
b601cb0cba
Fix funding.yml
2019-07-11 00:36:09 -07:00
jbarlow83 and GitHub
0c781faf89
Create funding.yml
...
[ci skip]
2019-07-11 00:35:39 -07:00
James R. Barlow
12769b96e5
Drop support for omitting pdfminer.six
2019-07-10 13:37:01 -07:00
James R. Barlow
a7b4ed9688
Double vertical bars for logo
2019-07-08 22:20:23 -07:00
James R. Barlow
ee92ce8717
gitattributes: ensure afdesign is okay
2019-07-08 22:16:47 -07:00
James R. Barlow
cbeddab35f
rename ocrmypdf.run -> ocrmypdf.ocr
2019-07-07 02:11:44 -07:00
James R. Barlow
98050534d6
logo: once more
2019-07-07 01:19:23 -07:00
James R. Barlow
9850231e91
(Hopefully) fix logo text invisible on Github
2019-07-07 01:12:52 -07:00
James R. Barlow
fd810239b5
Add a logo
2019-07-07 01:07:48 -07:00
James R. Barlow
2cff6ad2d1
Fixed blank pages produced when NULs removed from metadata
2019-07-03 02:22:50 -07:00
James R. Barlow
3ee306184b
Don't overwrite input PDF when fixing NULs in metadata
2019-07-03 01:57:58 -07:00
James R. Barlow
1cc4c45b7e
docs: mention WSL works
...
[ci skip]
2019-07-03 00:49:06 -07:00
James R. Barlow
a86cb8148a
Fix jbig2 not checked for special colorspaces
2019-07-02 13:50:29 -07:00
James R. Barlow
eeae6f8292
test: Add syntax checks for shell completions
2019-07-02 13:49:17 -07:00
James R. Barlow
4dab299619
Fix parameterization of --verbose
2019-07-02 13:27:07 -07:00
James R. Barlow
340e2bbac6
Drop --mask-barcodes from completions
2019-07-02 13:10:05 -07:00
James R. Barlow
187283192b
Fix reporting output file size skipped
...
Due to change to using finally for clean up
2019-06-30 15:08:10 -07:00
James R. Barlow
f855bdd36b
Docker: Ubuntu image should be manylinux1 compatible
2019-06-24 01:32:42 -07:00
James R. Barlow
9873d51f58
release notes: add next
2019-06-23 16:54:53 -07:00
James R. Barlow
11a57c7a17
Drop --mask-barcodes feature
2019-06-23 16:54:43 -07:00
James R. Barlow
8aa678859d
Use pandoc to rewrite .rst files
...
Fixes all of the long lines, mainly.
2019-06-22 17:29:26 -07:00
James R. Barlow
1beb7dfd37
helpers: don't expect psutil will be installed
...
It's not in stdlib
2019-06-22 02:36:06 -07:00
James R. Barlow
9b60d3e285
Improve testing of _validation.py
2019-06-22 02:33:04 -07:00
James R. Barlow
3331a686fa
Fix tess_threads clamped to 1
2019-06-22 00:59:33 -07:00
James R. Barlow
c32ea3b374
If a page have vector content, promote to full color
2019-06-22 00:59:04 -07:00
James R. Barlow
c357d4146e
Restructure ocrmypdf.pdfinfo
2019-06-20 03:10:41 -07:00
James R. Barlow
f47cb2fade
docs: update ocrmypdf.ocrmypdf to .run
2019-06-20 02:45:14 -07:00
James R. Barlow
9c4b1aeb8d
docs: plugin; renaming
2019-06-20 02:44:54 -07:00
James R. Barlow
51ed381bfc
Rename weave -> graft
2019-06-13 01:16:56 -07:00
James R. Barlow
5ee45411c9
Decide on OMP_THREAD_LIMIT more intelligently
2019-06-13 01:02:07 -07:00
James R. Barlow
16990890d8
Remove "from ocrmypdf import ocrmypdf"
...
Messes up future imports from ocrmypdf, so don't do it.
2019-06-12 17:52:25 -07:00
James R. Barlow
cfb11559d5
logging: capture warnings too
2019-06-12 17:28:02 -07:00
James R. Barlow
8b8de7cc1d
Add new --pages feature to limit OCR to only specific pages
2019-06-12 17:27:47 -07:00
James R. Barlow
aba293fd80
Change "Temporary working files" output message
2019-06-12 13:56:02 -07:00
James R. Barlow
066a293462
If verbose, print stacktrace on KeyboardInterrupt
2019-06-12 13:55:43 -07:00
James R. Barlow
0bbd6885e2
Make the go/no-go decision pluggable
2019-06-06 23:07:46 -07:00
James R. Barlow
5dd10c961c
Docker: prefer streaming
2019-06-05 03:14:36 -07:00
James R. Barlow
81fc95556c
Add progress bar for PdfInfo step
2019-06-05 03:08:04 -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
93f1b73579
Fix --remove-vectors which was broken in API migration
...
It got dropped during the change. This feature has also been altered so that
the final visual appearance of the file is not affected, only the OCR image.
2019-06-05 02:04:45 -07:00
James R. Barlow
fd427a8ec1
plugins: replace path manipulation
2019-06-05 01:46:56 -07:00
James R. Barlow
9444cf357b
optimize: add divide by zero check
2019-06-04 02:01:53 -07:00
James R. Barlow
5ab69153ee
Fix .coveragerc
2019-06-03 02:26:49 -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
98a3fda1f5
Drop support for Tesseract 4 alpha releases without textonly_pdf (mostly)
...
hocr renderer can still be used
2019-06-03 01:39:41 -07:00
James R. Barlow
e73740ae9d
test: remove test code that support tess3 or tess4 testing
2019-06-03 01:33:24 -07:00
James R. Barlow
fb933edc0f
Use newer pytest tmp_path API
2019-06-01 01:55:51 -07:00
James R. Barlow
ba41ccae1b
conftest: don't modify PYTEST_CURRENT_TEST when manipulating os.environ
...
It confuses pytest.
2019-06-01 01:41:39 -07:00
James R. Barlow
df9e286e9c
Make bypassed exception clearer
2019-06-01 01:35:15 -07:00
James R. Barlow
b9d6e46572
shutil.rmtree: use builtin error suppression
2019-05-31 15:12:46 -07:00
James R. Barlow
8347c0d662
validation: remove dead code check_input_file
2019-05-31 01:57:08 -07:00
James R. Barlow
45a361d112
Add option to use threads instead of processes
...
Mainly since they are more convenient for debugging
2019-05-31 01:56:16 -07:00
James R. Barlow
522e1e948b
ghostscript: don't use threads= for generate_pdfa
...
Not supported for pdfwrite
2019-05-31 01:55:29 -07:00
James R. Barlow
8ed4e229f3
ghostscript: avoid log=None construct
2019-05-30 13:57:38 -07:00
James R. Barlow
db29cae177
Docker docs: Remove legacy images, revive Ubuntu
2019-05-28 21:36:45 -07:00
James R. Barlow
d5b6cbb95e
Update Ubuntu dockerfile
2019-05-28 15:36:50 -07:00
James R. Barlow
396c39978a
Reorganize .docker folder so we don't have to rebuild as much
2019-05-28 14:18:54 -07:00
James R. Barlow
9d5f23e961
Rename filters to plugins
2019-05-28 02:39:25 -07:00
James R. Barlow
26a6232e1c
Ignore DSStore
2019-05-28 02:33:35 -07:00
James R. Barlow
7566d4b768
Introduce plugins/filters
2019-05-27 16:55:04 -07:00
James R. Barlow
5c4c32ab3c
Remove multiprocessing tests - no longer valid
2019-05-27 12:07:20 -07:00
James R. Barlow
692f7b3151
Dockerfile: with newer pip
...
Newer pip seems to install ocrmypdf-*.dist-info and has no problem reporting
installed version unlike -egg-info, so
skip copying.
Also move WORKDIR
2019-05-26 04:31:53 -07:00
James R. Barlow
8d0958d7ea
Dockerfile: qpdf-dev needs to be requested explicitly
2019-05-26 04:30:34 -07:00
James R. Barlow
e9731b6bac
Docker: upgrade pip, temporarily enable community repository for qpdf
2019-05-26 04:00:24 -07:00
James R. Barlow
0628a89041
docs: mention how to use Docker image shell
2019-05-26 00:20:40 -07:00
James R. Barlow
c14f62752b
Tests: add an API test
2019-05-25 16:24:09 -07:00
James R. Barlow
24855045e1
Provisionally add filters
2019-05-25 16:23:39 -07:00
James R. Barlow
ed236e0c27
Begin API documentation
2019-05-24 01:05:32 -07:00
James R. Barlow
db6aa22eae
Progress bar: unit types
2019-05-23 02:00:47 -07:00
James R. Barlow
805aa776ad
Re-disable progress bar when not connected to tty
2019-05-23 02:00:35 -07:00
James R. Barlow
d0efdf643c
Cleanup working files when done with a particular file, rather than end of process
2019-05-23 01:25:08 -07:00
James R. Barlow
22298b31be
Fix distinction between clean and clean_final lost in API refactor
2019-05-23 01:19:58 -07:00
James R. Barlow
5cecb3ecb4
Convert one test to use API
2019-05-22 23:53:48 -07:00
James R. Barlow
a139e64c67
api: short-circuit exception handler, as caller should provide their own
2019-05-22 18:30:30 -07:00
James R. Barlow
db69b4d11a
Improve argparse behavior for its role in making the API work
2019-05-22 15:55:48 -07:00
James R. Barlow
8bcb85720c
release notes: clarify
2019-05-22 15:34:23 -07:00
James R. Barlow
09ca1bee97
Add progress bar to optimize and add option to disable it
2019-05-22 15:31:48 -07:00
James R. Barlow
23dd77ce0f
api: fix progress_bar_friendly=False
2019-05-22 15:31:03 -07:00
James R. Barlow
32a076c039
Refactor validation and exceptions
...
CLI now tracks check_options exceptions. API now works more like
an API, without an exception handler,
because the caller should provide one.
2019-05-20 18:01:17 -07:00
James R. Barlow
e4baa8c0dd
Remove sys.exit() calls so we don't terminate caller application
2019-05-20 15:08:20 -07:00
James R. Barlow
2fdaa76a0d
Refactor configure_logging
2019-05-20 14:54:34 -07:00
James R. Barlow
7ee0c52a57
Refactor cli into basic high level api
2019-05-19 22:34:45 -07:00
James R. Barlow
ac2fc9c2a0
Explain picklable logger
2019-05-19 15:06:47 -07:00
James R. Barlow
188e08e98b
docs: Remove discussion of ruffus
2019-05-17 22:28:28 -07:00
James R. Barlow
ef1ef1cdf0
Fix test invalidated by Python 3.6 logging fixes
2019-05-17 15:20:07 -07:00
James R. Barlow
24da92d39e
Fix extra blank lines in output messages in Python 3.6
2019-05-17 14:56:33 -07:00
James R. Barlow
61afef549e
Remove some now-unused code; etc
2019-05-17 14:25:17 -07:00
James R. Barlow
cfd67ab6aa
Fixing threading._RLock exception on Python 3.6
...
Issue was the usual business: objects that cross process boundaries need
to be picklable and Python 3.6 is more strict about this. The logger
object in particular interfered, so now we suppress it and rebuild it
in process.
2019-05-17 14:24:47 -07:00
James R. Barlow
56067b590b
Make re_symlink() not require a log object
2019-05-17 01:59:36 -07:00
James R. Barlow
4340ad9f12
Update test cache
2019-05-17 01:45:06 -07:00
James R. Barlow
70def4a0d0
validation: eliminate print()
2019-05-17 01:43:26 -07:00
James R. Barlow
8df1ea2754
Mark some slow tests
2019-05-17 01:42:27 -07:00
James R. Barlow
e528adc603
pylint removal
2019-05-17 01:09:06 -07:00
James R. Barlow
c1af0fb18d
Cleanup ghostscript error output
2019-05-17 00:50:29 -07:00
James R. Barlow
0cb4e854e5
Replace ProcessPoolExecutor with multiprocessing.Pool
...
There seems to be no reasonable way to handle Ctrl-C with a
ProcessPoolExecutor. Or at least you have to press it several times to
actually kill. Pool does the job.
2019-05-17 00:48:06 -07:00
James R. Barlow
13ab23ba54
Refactor weave_layers, introduce progress bar
...
Fixes a bug in this branch where --sidecar would fail by trying to iterator
the executor futures twice.
2019-05-16 14:57:31 -07:00
James R. Barlow
19263f00c6
Additional logging fixes; silence extremely verbose pdfminer logging
2019-05-16 13:44:44 -07:00
James R. Barlow
50bd129d7a
logging: don't pass log object to validation
2019-05-16 01:58:48 -07:00
James R. Barlow
471cdea232
Move app specific settings a library may not want to __main__
2019-05-16 01:29:26 -07:00
James R. Barlow
9d750828c7
Make logging format consistent with v8.3.0
2019-05-16 00:48:40 -07:00
James R. Barlow
5e025c3382
Reinstate log level in messages to be closer to old behavior
2019-05-15 15:46:36 -07:00
James R. Barlow
4410503349
More fixes to logging and disabled tests
2019-05-15 03:08:09 -07:00
James R. Barlow
486f73d5d6
Remove custom logger
2019-05-15 02:28:13 -07:00
James R. Barlow
b10285d11b
Fix warnings
2019-05-14 16:34:42 -07:00
James R. Barlow
c904b430b6
Merge master into api branch; all test pass
2019-05-14 16:33:02 -07:00
James R. Barlow
07d4fff3d4
docs: mention FreeBSD works
2019-05-14 02:13:56 -07:00
James R. Barlow
7e388f59af
Move completions to better location/Homebrew compat
2019-05-13 00:22:52 -07:00
James R. Barlow
84ec83151d
v8.3.0 notes: clarify
2019-05-12 03:36:41 -07:00
James R. Barlow
0a72c12ff0
weave: add new test for link consistency
2019-05-12 03:36:33 -07:00
James R. Barlow
5adbddd1f9
ghostscript: rendering threads has no effect on pdfwrite, so remove it
...
See
https://www.ghostscript.com/doc/current/Language.htm
2019-05-12 03:36:07 -07:00
James R. Barlow
c2fecffdb4
Require pikepdf 1.3.0
2019-05-12 02:16:05 -07:00
James R. Barlow
7dea0a8362
v8.3.0 release notes in progress
2019-05-11 12:50:44 -07:00
James R. Barlow
482cb788ed
Don't use MagicMock() as a dummy logger in pytest
2019-05-11 12:44:17 -07:00
James R. Barlow
15a988b999
weave: use emplacement method, scrap TOC repair
...
The new emplacement method updates page objects in place without
generating new objgen numbers, meaning we no longer need to update the table
of contents to preserve links.
2019-05-11 12:40:25 -07:00
James R. Barlow
83398e54ea
weave: fix corruption of certain high page count files
...
Corruption occurred when replacements was not incremented for multiple
consecutive pages.
2019-05-11 12:22:21 -07:00
James R. Barlow
bcdd196699
ghostscript: remove unnecessary post-render resizing step
2019-05-11 12:10:50 -07:00
James R. Barlow
0cd576e701
Rename bash completions file
2019-05-11 10:52:42 -07:00
James R. Barlow
4d5e0eb749
docs: mention completions
2019-05-06 18:07:41 -07:00
Frank and jbarlow83
7ed0f8f50e
Add bash completion ( #384 )
...
* Add bash completion
file must be copied to completion folder e.g. /usr/share/bash-completion/completions
2019-05-06 15:18:15 -07:00
James R. Barlow
79c84eefa3
Fix main.txt
2019-04-23 02:21:31 -07:00
James R. Barlow
5398003160
Fix test.txt
2019-04-23 00:42:40 -07:00
James R. Barlow
58b2bed99d
v8.2.4 notes
2019-04-23 00:07:12 -07:00
James R. Barlow
58c29ffb5c
weave: use explicit pdf.close(), drastically reduce open file handles
...
With the new pikepdf 1.2.0 we no longer need to hold file handles
open because of the "copy to memory" functionality. We retain
the behavior of closing/reopening the output PDF every 100 pages as
a way to limit memory usage.
2019-04-18 15:12:48 -07:00
James R. Barlow
f615b6f0e8
pdfinfo: be more specific about detecting XFA we can't render
2019-04-18 15:07:25 -07:00
James R. Barlow
e0c8dadcce
Explicitly close most pikepdf.Pdf when done with them
2019-04-18 15:02:12 -07:00
James R. Barlow
9a86f53109
Ignore pip-wheel-metadata folder
...
https://github.com/pypa/pip/issues/6213
2019-04-18 10:42:10 -07:00
James R. Barlow
91cb092aa0
Remove PyCharm debugger hack
2019-04-18 10:15:02 -07:00
James R. Barlow
f4b87915df
Fix --redo-ocr
2019-04-15 13:11:26 -07:00
James R. Barlow
922a107b7f
Remove safety traversal of PDF table of contents
...
qpdf fixed the danging reference issue (qpdf #240 ) in 8.3.0, which is
required by pikepdf 1.1.0. We no
longer need the workaround.
2019-04-13 00:24:03 -07:00
mawi
1c44fd4f3b
fix: typo
2019-04-08 15:01:04 +02:00
mawi
c92ccc6134
fix: tests
2019-04-08 14:57:42 +02:00
mawi
1137534e97
fix: update pytest version
...
Solves install error: pkg_resources.ContextualVersionConflict: (pytest 4.3.0 (/app/.eggs/pytest-4.3.0-py3.6.egg), Requirement.parse('pytest>=4.4.0'), {'pytest-xdist'})
2019-04-08 11:08:29 +02:00
mawi
39617dd739
fix: remove ruffus
2019-04-08 11:07:32 +02:00
mawi
6590875756
feat: add triage step
...
remove tqdm demo
2019-04-08 10:26:56 +02:00
mawi
01bbf064e0
feat: add tqdm progress bar
...
This is just a POC. Will be removed.
2019-04-05 19:52:38 +02:00
mawi
fc1c4f12f5
feat: add concurrent.futures pipeline
2019-04-05 18:48:34 +02:00
mawi
2647382cf6
fix: most of the tests (37 failed, 133 passed, 28 skipped)
2019-04-05 14:06:07 +02:00
mawi
783a128bd1
feat: move to sync (none ETL) implementation - remove ruffus
2019-04-04 21:02:38 +02:00
Martin Wind
b214aa5b38
feat: move to sync (none ETL) implementation
2019-04-03 19:59:43 +02:00
James R. Barlow
6e49bb3588
v8.2.3 notes
2019-04-03 01:19:12 -07:00
Martin Wind
aa512b6181
feat: move to sync (none ETL) implementation (WIP)
2019-04-02 20:03:09 +02:00
Martin Wind
a4667b5656
refactor: move ruffus related code to one file
2019-03-28 20:16:10 +01:00
Martin Wind
f65a3d3762
fix import in unpaper test
2019-03-26 10:04:26 +01:00
Martin Wind
2fa43ecf09
refactor: split argparse and run_pipline
2019-03-26 08:10:20 +01:00
James R. Barlow
427afc0616
Fix LeptonicaErrorTrap when a sys.stderr.fileno() is not available
...
The LeptonicaErrorTrap was problematic for Celery and other
libraries that mess with stderr.
Closes #359
2019-03-17 14:22:36 -07:00
James R. Barlow
9c7ee2bf23
Better help text for --verbose
2019-03-17 13:29:25 -07:00
James R. Barlow
c5cfaa950b
readme: tweaks
2019-03-16 14:09:19 -07:00
James R. Barlow
4e2a98ead4
leptonica: fix junkpixt harder
2019-03-16 14:08:58 -07:00
James R. Barlow
210f134b5b
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2019-03-08 15:38:31 -08:00
James R. Barlow
696c0721a0
docs: fix broken sphinx ref
...
[ci skip]
2019-03-08 15:38:26 -08:00
James R. Barlow
aabab95418
docs: use images folder
2019-03-08 15:38:01 -08:00
James R. Barlow
7d614dd68b
docs: explain Automator workflow
2019-03-08 15:37:42 -08:00
jumblies and jbarlow83
f57dda7939
Update batch.rst ( #362 )
...
Added docker instructions for passing "find" filenames into container. Obviates prior incorrect flag fix.
2019-03-08 12:46:50 -08:00
James R. Barlow
1b4542aa77
Further fixes to external program version testing
2019-03-07 14:27:16 -08:00
James R. Barlow
6c7fca57ec
v8.2.1 notes
2019-03-06 22:22:50 -08:00
James R. Barlow
486dc7e22c
Fix some test failures missed in prev commit
2019-03-06 13:28:50 -08:00
James R. Barlow
dc616bb507
Fix test suite so --clean is not requested when unpaper is not installed
2019-03-05 22:33:13 -08:00
James R. Barlow
902bda43e3
main: fix version testing unnecessarily throwing exception to itself
2019-03-05 22:32:06 -08:00
James R. Barlow
f7da63f68b
main: fix redundant argument test
2019-03-05 22:29:29 -08:00
James R. Barlow
5da26e4c9c
Convert most uses of subprocess.Popen to subprocess.run in test suite
2019-03-05 22:25:22 -08:00
James R. Barlow
c19c852705
Fix exception while attempting to print error message for missing program
2019-03-05 16:32:48 -08:00
James R. Barlow
a27ee3ee8c
optimize: use Decode to invert 1bpp PNGs for now
2019-03-03 17:50:12 -08:00
James R. Barlow
c2f316c2c5
v8.2.0 release notes: optimizer
2019-03-03 15:26:01 -08:00
James R. Barlow
974979b0a0
Merge branch 'feature/optimization-fixes'
2019-03-03 15:00:20 -08:00
James R. Barlow
66586bdaab
optimize: Disable jpg->png migration
...
Needs more testing before release
2019-03-03 14:59:59 -08:00
James R. Barlow
01d2ea309f
Fix Predictor name and photometric flip
2019-03-03 14:57:15 -08:00
James R. Barlow
e918480351
v8.2.0 release notes
2019-03-03 14:15:20 -08:00
James R. Barlow
52fd84fa95
Remove debug message
2019-03-03 13:31:10 -08:00
James R. Barlow
2c56b0935c
docs: minor
2019-03-03 03:28:17 -08:00
James R. Barlow
4f69ace868
optimize: fix all JBIG2 images binned on last page
...
During some past refactor it appears we now end up treating
all JBIG2 images as if they appeared on the last page in the
file. This bug had no visual side ffects but probably led to
suboptimal JBIG2 encoding.
2019-03-03 03:28:17 -08:00
James R. Barlow
497c531112
optimize: update comments
2019-03-03 03:28:17 -08:00
James R. Barlow
b27b92fbf3
optimize: on aggressive settings try JPG to PNG transcoding
...
If the color count of an image is low such as when black and white
documents are scanned in color, PNG with lossy quantization may
produce a superior encoding to JPEG. This is expensive to test however.
2019-03-03 03:28:17 -08:00
James R. Barlow
2e6ba2df8c
optimize: fix recoding of PNGs
...
Previously we opened pngquant-compressed PNGs with transcoding
because the transcode free function in Leptonica didn't seem to
work. This mean Leptonica may have thrown away the hard of
pngquant if didn't understand the encoding.
This change resolves the issue and allows us to open PNG encoded
data and insert it into a PDF without transcoding. Should improve
encoding quality.
2019-03-03 03:28:17 -08:00
James R. Barlow
67a405c6b7
Move install-time external program checks out of setup.py
...
We did runtime tests for several of them anyway, and it's better to do
at runtime since config may change after installation.
2019-03-03 03:26:56 -08:00
James R. Barlow
58e6663806
Update test cache for french->german change
2019-03-03 03:23:59 -08:00
James R. Barlow
602570fcf9
Update requirements
2019-03-03 02:27:56 -08:00
James R. Barlow
691f8ce254
Docs: reorganize for new docker-alpine image
2019-03-01 23:15:32 -08:00
James R. Barlow
22812e74b9
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2019-02-26 13:01:59 -08:00
Martin Wind and jbarlow83
9d824e723d
Add Dockerfile based on alpine:3.9 ( #354 )
...
* Do not exclude .git from docker build
* Use multi-stage builds to keep the image size down
* Copy project files to get the test suite.
* Add webservice
* Add tesseract language data for German and Chinese Simplified
2019-02-26 13:01:38 -08:00
James R. Barlow
5dad800d85
Add version to build-system declaration
2019-02-26 12:58:44 -08:00
James R. Barlow
56a56a4dcb
docs: avoid importing ocrmypdf
2019-02-26 12:57:50 -08:00
James R. Barlow
3f1d9ef99c
Fix tests for move to Alpine dockerfile
2019-02-26 12:30:21 -08:00
James R. Barlow
92c8a5885e
Declare build system in pyproject.toml
2019-02-26 12:23:33 -08:00
James R. Barlow
7749d14252
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2019-02-24 01:56:47 -08:00
Julien Ma and jbarlow83
9b92af5aed
README: install other language packs on macOS ( #352 )
...
The default homebrew formula installs only the English language pack.
Another brew formula exists to install all other language packs.
This makes it easier than having to do the whole install manually.
2019-02-19 10:13:36 -08:00
James R. Barlow
0bf26b03ae
optimize: Modernize pikepdf usage
2019-02-16 14:03:10 -08:00
James R. Barlow
e2847ea4c3
v8.1.0 release notes
2019-02-10 02:10:48 -08: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
df688742d5
Fix exception on traversing corrupt ToC entries
2019-02-10 00:50:21 -08:00
James R. Barlow
42c2925f9d
Activate black precommit
2019-02-08 14:09:08 -08:00
James R. Barlow
933f0b8f9b
docs: more unpaper details
2019-02-08 13:05:09 -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
4f06920224
Be os.nice()-r
2019-02-07 17:24:47 -08:00
James R. Barlow
a733b09623
webservice: add an optional config and larger upload limit
2019-02-07 17:24:17 -08:00
James R. Barlow
5483dacf52
Fuzz
2019-02-07 17:09:47 -08:00
James R. Barlow
ae7844ad88
--clean-final implies --clean
...
It's never made sense to leave it out before; might as well introduce it.
2019-02-07 17:08:08 -08:00
James R. Barlow
a6e7485da6
docs: --unpaper-args
2019-02-07 17:06:51 -08:00
James R. Barlow
3bcc6d6121
Merge 'feature/unpaper-args'
2019-02-07 17:06:28 -08:00
James R. Barlow
9fe067bbd9
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2019-02-07 16:31:06 -08:00
James R. Barlow
f095e91cb4
unpaper-args: add test case and harden feature
2019-02-07 16:21:02 -08:00
Charles Forcey and jbarlow83
66c8d4b47a
Adjust the docker pull command for webservice ( #346 )
...
Not completely sure this is correct, but I think `docker pull jbarlow83/ocrmypdf-webservice` might be the correct command for getting the web service version. It installs as expected:
```
docker pull jbarlow83/ocrmypdf-webservice
Using default tag: latest
latest: Pulling from jbarlow83/ocrmypdf-webservice
38e2e6cd5626: Already exists
705054bc3f5b: Already exists
c7051e069564: Already exists
7308e914506c: Already exists
3977c3cd82d1: Already exists
ec01b9573956: Already exists
b508b5192a3c: Already exists
ace6e737fffb: Already exists
0a453ee84e11: Already exists
f8cb8b66151b: Already exists
f53c3b27b23f: Already exists
22df51ea5473: Already exists
e38d932f9f30: Already exists
b9d3c1d5b53b: Already exists
68be2088ada3: Already exists
8b17945ab41b: Pull complete
59c4aae491bd: Pull complete
19dce698a07e: Pull complete
Digest: sha256:0cc9433d490c9a65389403757bf6081a30bcd248055340a8789c23d9cdf9ac8a
Status: Downloaded newer image for jbarlow83/ocrmypdf-webservice:latest
```
2019-01-25 10:41:42 -08:00
James R. Barlow
721489a06c
docs: remove reference to --skip-repair since the argument was removed
2019-01-18 05:44:11 -08:00
James R. Barlow
9a4493f211
Add --unpaper-args
...
Needs test code and stricter validation
2019-01-18 05:33:28 -08:00
James R. Barlow
edb4d6c586
docs: Clarify ArchLinux edition is in AUR
2019-01-18 05:29:37 -08:00
James R. Barlow
b8cd3acd9e
v8.0.1 notes
2019-01-17 00:57:28 -08:00
James R. Barlow
03779e33da
docs: Update some install procedures for v8 changes
...
[ci skip]
2019-01-12 00:33:36 -08:00
James R. Barlow
c466483e82
docs: Explain intermediate files
2019-01-11 14:52:05 -08:00
James R. Barlow
e3a58219d1
Ensure XObjects with no subtype don't cause an exception
...
Closes #325
2019-01-08 16:46:08 -08:00
James R. Barlow
72337094ca
v8.0.0 release notes
2019-01-05 23:35:47 -08:00
James R. Barlow
f472587d22
Bump pikepdf version, point to release notes
2019-01-05 16:48:13 -08:00
James R. Barlow
f34b3015b2
Prevent Ghostscript from generating invalid XMP metadata
...
If DocumentInfo contains NULs Ghostscript will generate XMP with
NULs which is not allowed. Repair DocumentInfo before Ghostscript sees it.
2019-01-04 13:20:41 -08:00
James R. Barlow
089ece2715
use pikepdf 0.10.2
2019-01-03 12:08:43 -08:00
James R. Barlow
6438465e3f
Add fish completions
2019-01-02 17:08:30 -08:00
James R. Barlow
7d330afd81
Delinting
2019-01-02 13:34:45 -08:00
James R. Barlow
68fbd9fcc9
pikepdf: version bump
2018-12-31 15:37:31 -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
c2a947acf4
travis: fix
2018-12-31 01:18:30 -08:00
James R. Barlow
8c0009c5c8
Make pdfminer.six optional
...
Mainly since the current release of pdfminer.six lacks a sdist, blocking
homebrew packaging. Also in case other distros don't accept pdfminer.six.
2018-12-31 01:08:43 -08:00
James R. Barlow
cfc5cdf47d
pdfa: remove a pile of deprecated code
...
It's now handled in pikepdf.
2018-12-31 00:05:13 -08:00
James R. Barlow
05152a8af9
Remove always-false Tess v3 tests
2018-12-30 02:01:05 -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
80bd7de580
Generate test cache
2018-12-30 01:02:37 -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
b4a51907d6
Detect when metadata is dropped during PDF/A conversion
2018-12-30 00:13:25 -08:00
James R. Barlow
1ca1221432
leptonica.py: Fix exception on certain types of barcode failures
...
Closes #322
2018-12-19 17:23:23 -08:00
James R. Barlow
40b72b0fa8
v7.4.1 release notes
2018-12-19 16:41:09 -08:00
James R. Barlow
0e55b4ad52
Travis: remove Brewfile
2018-12-19 16:40:48 -08:00
James R. Barlow
7b4f5a8fc4
docs: try to fix readthedocs
...
[ci skip]
2018-12-19 15:30:07 -08:00
James R. Barlow
9261a38493
Readme: more media
2018-12-19 15:27:54 -08:00
James R. Barlow
cc8ff318ed
New issue template
2018-12-19 15:27:44 -08:00
James R. Barlow
ad15e845f9
docs: Ghostscript PDF/A XMP metadata loss; ocrmypdf-webservice
...
[ci skip]
2018-12-17 23:20:49 -08:00
James R. Barlow
ab632f57cd
v7.4.0 release notes
2018-12-15 15:27:23 -08:00
James R. Barlow
13d20bd993
pdfinfo: tolerate PDFs that overflow and underflow the graphics stack
2018-12-15 15:10:29 -08:00
James R. Barlow
b973208137
Require pikepdf 0.9.1
2018-12-15 14:23:10 -08:00
James R. Barlow
942abf8074
Fix reqs/main.txt for pikepdf 0.9.0
2018-12-14 23:29:26 -08:00
James R. Barlow
ed9bb985e2
Fix pikepdf 0.9.0
2018-12-14 23:21:13 -08:00
James R. Barlow
5a7a8e573b
Require pikepdf 0.9.0
2018-12-14 23:06:57 -08:00
James R. Barlow
ce878db913
Rename to polyglot.dockerfile
2018-12-14 23:06:29 -08:00
James R. Barlow
a3d58683b2
Update webservice.py with separate license
2018-12-14 23:05:54 -08:00
James R. Barlow
039e8ca7e7
Merge branches 'feature/newer-pike' and 'feature/webapp'
2018-12-14 18:08:31 -08:00
James R. Barlow
0ebbd4e21b
Don't open encrypted files, even if password is empty
2018-12-13 22:48:00 -08:00
James R. Barlow
2cb75f6076
Refactor pipeline to make PDF/A conversion a separate step
2018-12-13 20:48:48 -08:00
James R. Barlow
857d871364
Fix regression on Ghostscript path
2018-12-13 20:36:41 -08:00
James R. Barlow
632dab2cc0
Replace Ghostscript DOCINFO and fix 9.25 metadata date regression
...
We no longer use Ghostscript to manage PDF metadata, instead
omitting the DOCINFO segment from the pdfmark file we generate.
Instead all of the relevant metadata code has been migrated to pikepdf,
and we use that API. This should be more consistent and fixes the
Ghostscript version-depedent quirks.
Also removes our python-xmp-toolkit dependency, except for
testing.
2018-12-13 18:13:30 -08:00
James R. Barlow
7647918f2d
setup: suppress XMLParser() warning - defusedxml related
2018-12-12 22:13:32 -08:00
James R. Barlow
75c5d8055c
pdfinfo: fix FutureWarning
2018-12-12 22:12:14 -08:00
James R. Barlow
a938bbea55
Remove more libxmp dependencies
2018-12-12 22:02:35 -08:00
James R. Barlow
414407fbd6
Deprecate encode/decode_pdf_date and remap to pikepdf version
2018-12-12 22:01:21 -08:00
James R. Barlow
076fc717df
pdfa: replace PDF/A checking with pikepdf implementation
2018-12-12 21:41:16 -08:00
James R. Barlow
2a04b2d82b
Rename webapp to webservice
2018-12-12 21:29:05 -08:00
James R. Barlow
065db414c0
webapp docker: Build from polyglot
2018-12-12 21:24:04 -08:00
James R. Barlow
19a054a78b
Add webapp stuff
2018-12-10 20:03:52 -08:00
James R. Barlow
9df24a81b7
Fix comment in layout.py
2018-11-28 15:16:34 -08:00
James R. Barlow
40c0acd3f2
Support using --force-ocr and --threshold or --mask-barcodes together
2018-11-28 15:16:24 -08:00
James R. Barlow
20db7f0a8f
leptonica: delete file junkpixt.png if created
2018-11-28 13:47:55 -08:00
James R. Barlow
e54f6ee37f
v7.3.1 release notes
2018-11-16 02:13:41 -08:00
James R. Barlow
2da556bf79
Fix unsupported operand Decimal, float
2018-11-16 02:13:25 -08:00
James R. Barlow
b183ad8167
Fix barcodes error handling
2018-11-16 02:08:16 -08:00
James R. Barlow
9e6b54c7ed
Add test case for Type3 fonts with no Unicode mapping
2018-11-15 21:54:26 -08:00
James R. Barlow
d3b334c10f
Test case: true type font without Unicode mapping
2018-11-15 16:22:53 -08:00
James R. Barlow
622f2c4bab
More argument checking
2018-11-15 15:59:38 -08:00
James R. Barlow
07b638a394
pdfminer: detect TrueType fonts with no valid encoding information
2018-11-15 13:44:11 -08:00
James R. Barlow
9bee2405d8
Leptonica: make threshold functions more flexible
2018-11-15 13:43:34 -08:00
James R. Barlow
8f040491bf
Fix erasure of undetectable barcodes
2018-11-15 12:03:51 -08:00
James R. Barlow
8a18988706
Fix 'del draw' exception
2018-11-15 12:02:53 -08:00
James R. Barlow
47a954514b
Fix name2unicode ignoring certain markers
2018-11-15 12:02:30 -08:00
James R. Barlow
e3b65d4288
Fix detailed page analysis enabled at wrong time
2018-11-15 12:02:08 -08:00
James R. Barlow
4704f7ed1d
Add ReadTheDocs yml so we can build with Py3.6
2018-11-12 13:43:17 -08:00
James R. Barlow
3a2745445a
Fix docs build
2018-11-12 13:26:04 -08:00
James R. Barlow
12e15bab15
v7.3.0 release notes
2018-11-11 02:05:52 -08:00
James R. Barlow
9593aa4fb9
Merge v7.3.0 development
2018-11-11 01:38:42 -08:00
James R. Barlow
817d520e63
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2018-11-11 01:34:00 -08:00
James R. Barlow
700abbb8a5
Documentation for OCR quality features
2018-11-10 15:48:41 -08:00
James R. Barlow
701ef1df3f
Add threshold function to work around Tesseract's poor thresholding of bright backgrounds
2018-11-10 15:34:37 -08:00
James R. Barlow
0f5c484b62
Travis: only need to specify chardet because we use pip install --no-deps
2018-11-10 13:57:04 -08:00
James R. Barlow
cc7f2a3f02
Fix Python 3.5 pathlib regressions
2018-11-10 02:11:23 -08:00
James R. Barlow
755b5d87e3
Add missing chardet, implied by pdfminer.six?
2018-11-10 01:50:51 -08:00
James R. Barlow
e55a4115e1
Travis: pytest 3.10.0 internal error?
2018-11-10 01:44:05 -08:00
James R. Barlow
16a6fd2ea9
Update docs for --redo-ocr and --mask-barcodes
2018-11-10 01:34:33 -08:00
James R. Barlow
e3fce112ed
main.txt: wrong pdfminer
2018-11-10 01:32:27 -08:00
James R. Barlow
eacd26a68b
Mention v6.2.5 release
2018-11-10 01:10:45 -08:00
James R. Barlow
0e88b3c38a
Update v7.3.0 release notes
2018-11-10 01:09:19 -08:00
James R. Barlow
a2170ef8d6
test: test version check code
2018-11-10 00:56:22 -08:00
James R. Barlow
eed0424390
Update requirements
2018-11-10 00:56:04 -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
58b26f6715
Leptonica: learn to despeckle 1bpp images
2018-11-07 01:49:13 -08:00
James R. Barlow
806daf4284
leptonica: reduce boilerplate for PIX (2/2)
2018-11-06 20:33:40 -08:00
James R. Barlow
c64bc9329e
leptonica: reduce boilerplate for wrapper classes (except PIX)
2018-11-06 20:12:09 -08:00
James R. Barlow
dd01745519
Leptonica: add masked threshold fn
2018-11-06 19:31:06 -08:00
James R. Barlow
501ce726e7
Fix two failing tests
2018-11-06 11:16:08 -08:00
James R. Barlow
03076e89ce
Leptonica: reduce verbosity, more error trapping, more garbage collection
2018-11-06 11:10:59 -08:00
James R. Barlow
02f37293ee
Integrate barcode masking
2018-11-05 13:01:13 -08:00
James R. Barlow
590942ad14
Leptonica: Add barcode API
2018-11-05 01:48:38 -08:00
James R. Barlow
2ac028c759
test: Add a basic redo OCR test
2018-11-04 15:54:41 -08:00
James R. Barlow
2125b5bfab
Remove text detection from our parser interpret_contents
...
It's redundant now
2018-11-04 15:47:55 -08:00
James R. Barlow
b96532caa4
Only do detailed page analysis when needed by --redo-ocr
2018-11-04 15:40:49 -08:00
James R. Barlow
995fc58466
Move Ghostscript text analysis into its own module
2018-11-04 14:55:48 -08:00
James R. Barlow
c023cae299
Make pdfminer Type3 patch conditional on PScript5.dll
...
It appears that PDFs created by this software have a bug in their BBox
which will cause us to misjudge the space occupied by the font.
Other programs probably work around this by ignoring BBox and reading
each character procedure.
2018-11-04 01:53:53 -07:00
James R. Barlow
237eaf9130
Exception message not printed in some cases
...
Closes #310
2018-11-03 17:10:24 -07:00
James R. Barlow
8b9ab25125
coverage: test compile leptonica
2018-11-02 01:55:25 -07:00
James R. Barlow
77e87abe8f
coverage: ensure get_orientation is checked
2018-11-02 01:32:20 -07:00
James R. Barlow
3be02e1e8d
coverage: improve leptonic; don't create objects with null pointers
2018-11-02 01:10:10 -07:00
James R. Barlow
64c9ede979
leptonica: barcodes, BOXA
2018-11-02 00:42:01 -07:00
James R. Barlow
5b8d197812
coverage: make it more likely timeout is tested
2018-11-02 00:41:15 -07:00
James R. Barlow
2cba62dc4f
coverage: ensure rotation is actually tested
2018-11-02 00:40:56 -07:00
James R. Barlow
288e28328f
coverage: add qpdf
2018-11-02 00:37:33 -07:00
James R. Barlow
b8214b3c49
coverage: exclude unicodefun.py
2018-11-02 00:33:08 -07:00
James R. Barlow
8681693994
Set up code coverage (it works with multiprocessing now!)
2018-11-02 00:31:50 -07:00
James R. Barlow
1364c63b7c
Fix failure to pickle file with AcroForm
2018-11-01 20:07:53 -07:00
James R. Barlow
4ba9e8fe25
Add AcroForm detection
2018-10-30 22:28:44 -07:00
James R. Barlow
a195713bb4
Throw exception on corrupt text
2018-10-30 16:35:09 -07:00
James R. Barlow
600d31a907
Require pikepdf 0.3.7
2018-10-30 16:22:05 -07:00
James R. Barlow
be31cec332
Add corrupt text warning (when using --redo-ocr)
2018-10-30 16:19:58 -07:00
James R. Barlow
22a7cd3421
Add argument checks for --redo-ocr
2018-10-30 16:19:13 -07:00
James R. Barlow
8b61d2d521
pdfminer: If font descent claims to be positive, treat it as negative
2018-10-30 14:40:53 -07:00
James R. Barlow
559e5269d2
Ensure inline image is parsed correctly
...
Requires pikepdf > 0.3.6
2018-10-29 23:30:53 -07:00
James R. Barlow
ebf6acb318
pdfminer patch: Type3 font height calculation is incorrect
...
Not sure where it goes wrong or why it needs special treatment, but
this does address it.
2018-10-29 22:27:25 -07:00
James R. Barlow
7acd75f013
pipeline: fix bbox coordinates
2018-10-29 22:26:37 -07:00
James R. Barlow
93623b2226
Refactor TextboxInfo
2018-10-29 14:46:40 -07:00
James R. Barlow
d71fd089cb
layout: allow names beginning with /i0123 for now
...
Showed up in GGastro2.pdf. Need to check if this pattern has valid
Unicode mappings but allow for now.
2018-10-29 14:45:59 -07:00
James R. Barlow
05aa43c856
Require pdfminer
2018-10-29 12:45:15 -07:00
James R. Barlow
de80fb6bc8
Fix some failing tests after --redo-ocr changes
2018-10-29 11:49:38 -07:00
James R. Barlow
8e396f4be2
Document --redo-ocr more accurately
2018-10-29 02:03:58 -07:00
James R. Barlow
efec6da377
Fix error on serializing bad character markers
...
(Since they held a reference to their font, which in turn, had an
open file handle.)
2018-10-29 02:02:00 -07:00
James R. Barlow
00ef53195e
Fix corrupt Unicode mapping detection's false positives
2018-10-29 01:30:19 -07:00
James R. Barlow
f564aaf485
Remove only_ocr_text
2018-10-28 22:41:18 -07:00
James R. Barlow
5ac2d31d0d
Redo OCR can now handle visible and invisible text, so adjust accordingly
...
Still can't filter out corrupt text
2018-10-28 14:06:25 -07:00
James R. Barlow
fda890ab47
pdfinfo: further layout improvements
...
Rather than grouping visible/invisible in a custom analysis step,
use pdfminer's analysis and iterate.
Make iteration predicate and return more generic.
2018-10-28 14:05:50 -07: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
e6d64be890
pdfinfo: formatting
2018-10-27 23:22:44 -07:00
James R. Barlow
0e4d978d20
pdfinfo: all -> not any
2018-10-27 23:22:28 -07:00
James R. Barlow
b12c2cfedf
Fix handling of Type3 fonts with no ToUnicode mapping
2018-10-27 01:24:48 -07:00
James R. Barlow
58cc70725e
Reorganize around getting bboxes for visible/invisible text
2018-10-26 01:07:02 -07:00
James R. Barlow
339afb02aa
--redo-ocr now works in the presence of printable text
2018-10-25 16:53:47 -07:00
James R. Barlow
7ba0ff5c36
Fix strip invisible text bug: missing BT operator
2018-10-25 16:52:23 -07:00
James R. Barlow
ff41fbf673
Add pdfminer based layout analysis
2018-10-25 12:42:35 -07:00
James R. Barlow
2435cd23ce
Move pdfinfo into a package
2018-10-25 00:37:38 -07:00
James R. Barlow
a063cff720
Rename/expose strip_invisible_text
2018-10-24 21:53:24 -07:00
James R. Barlow
0d396e1ac0
option check: Remove always-True condition
...
Both renderers are now lossless reconstruction-capable. (Have
been since 7.0)
2018-10-22 22:13:59 -07:00
James R. Barlow
f5807a2053
Require pikepdf 0.3.5
2018-10-21 21:37:15 -07:00
James R. Barlow
eb4938a36f
Fix KeyError 'has_vector'
2018-10-20 01:20:22 -07:00
James R. Barlow
c5ad530bbf
pdfinfo: reminder about 'INLINE IMAGE' sentinel
2018-10-20 01:17:08 -07:00
James R. Barlow
d11c428407
Redo OCR: disallow in cases that will damage the output PDF
2018-10-20 01:14:33 -07:00
James R. Barlow
6182b1f53e
Merge branch 'feature/remove-vectors' into feature/redo-ocr
2018-10-20 01:13:24 -07:00
James R. Barlow
00fc1a12e2
optimize: should remove unreference resources too
2018-10-19 00:03:56 -07:00
James R. Barlow
16af753206
Add functional "redo OCR" feature
...
Needs argument validation and some other changes. Needs testing
with mixed-content PDFs.
Only really works for pure invisible text at the moment.
2018-10-19 00:02:19 -07:00
James R. Barlow
fa48205bb8
Add feature to remove vector graphics objects
2018-10-18 21:46:08 -07:00
James R. Barlow
f7dbf94071
pipeline: if vector graphic objects exist, ensure the DPI is reasonable
2018-10-18 01:23:31 -07:00
James R. Barlow
b18e66e2ca
pdfinfo: learn to detect vector graphic objects
2018-10-18 01:21:51 -07:00
James R. Barlow
7a5504dfa5
pdfinfo: fix terminology (operands, command) -> (operands, operator)
2018-10-18 01:18:30 -07:00
James R. Barlow
d1cad7bc68
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2018-10-16 01:28:17 -07:00
Elliott Sales de Andrade and jbarlow83
c58d5c097c
Add Fedora install instructions. ( #304 )
...
* Add Fedora install instructions.
* Fix path to fedora_rawhide badget
2018-10-14 13:28:50 -07:00
James R. Barlow
46157ca94e
docs: some redundancies
2018-10-12 21:29:27 -07:00
jbarlow83 and GitHub
dd99511bcc
Fix broken badges in README
2018-10-12 21:16:08 -07:00
M.Yasoob Ullah Khalid ☺ and jbarlow83
5bc2efd3c7
Removed extra word from docs ( #303 )
2018-10-12 21:02:16 -07:00
James R. Barlow
1b18dbecf5
Fix filename test.txt
2018-10-11 16:03:25 -07:00
James R. Barlow
9f82c0eb6e
v7.2.1 release notes
2018-10-11 15:55:01 -07:00
James R. Barlow
68bac1b177
Fix compatibility with pikepdf 0.3.5 API change
2018-10-11 15:51:34 -07:00
James R. Barlow
1495b78330
Remove cruft to support leptonica < 1.72 in test suite
2018-10-11 01:37:32 -07:00
James R. Barlow
6f777d2848
Include Debian copyright file
2018-10-10 23:55:48 -07:00
James R. Barlow
5650eba848
Cleanup MANIFEST.in, reorg requirements/*.txt, fix non-Unicode readme
2018-10-10 23:53:08 -07:00
James R. Barlow
5bc5dc93f3
v7.2.0 release notes update
2018-10-05 01:27:00 -07:00
James R. Barlow
c1e18bb825
optimize: Exclude soft masks (SMasks) from optimization
...
Soft masks are only allowed to be of colorspace DeviceGray so we
shouldn't use pngquant on them. For now, avoid this exceptional
case by excluded soft masks from optimization.
2018-10-05 01:23:26 -07:00
James R. Barlow
58282ea0fb
optimize: more refactoring
...
Now properly generalized/specialized where it should be
2018-10-04 13:44:51 -07:00
James R. Barlow
891da7834c
optimize: refactor image extraction
2018-10-04 12:34:22 -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
53f660cf35
Travis: use newer macos image
2018-10-04 08:59:40 -07:00
James R. Barlow
7b66ca68f2
...and document lossy JBIG2
2018-10-04 01:31:53 -07:00
James R. Barlow
ba71c3ffbd
requirements: request pikepdf 0.3.4
2018-10-04 01:22:03 -07:00
James R. Barlow
6707ad427a
v7.2.0 release notes
2018-10-04 01:21:17 -07:00
James R. Barlow
5b84549716
Change JBIG2 lossy mode to require --jbig2-lossy
2018-10-04 01:20:49 -07:00
James R. Barlow
c74f2ee6e8
Refactor the detailed error messages
2018-10-04 00:10:59 -07:00
James R. Barlow
b32dd9f9d3
Fix lossless JBIG2 when there are multiple JBIG2 images on a single page
2018-10-03 17:40:26 -07:00
James R. Barlow
fb8b161f6c
Fix suppression of tesseract config error messages
2018-10-03 17:39:50 -07:00
James R. Barlow
baddd6d233
Remove libtiff from Brewfile
...
For some reason, brew complains about it now.
2018-10-03 16:17:59 -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
a71e4488b3
test: fix pytest warning about direct use of a fixture
2018-10-03 15:04:46 -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
9fa471e053
Test: send stderr to stderr, why don't we?
2018-10-03 14:23:34 -07:00
James R. Barlow
31ef2fe907
test: this error message changed case in newer Tesseract
2018-10-03 13:58: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
29116e1dec
Change to README.md
2018-09-19 21:01:24 -07:00
James R. Barlow
87193335b9
v7.1.0 notes
2018-09-19 20:57:18 -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
eaa324939f
Upgrade to pikepdf 0.3.3
...
Closes #231
2018-09-19 15:30:54 -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
eaf772f80a
Merge v6.2.4 release notes
2018-09-16 15:45:38 -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
2659afb4f6
Cleanup gitignore
2018-09-14 21:02:22 -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
c54d0c7eaa
v7.0.5 release notes
2018-09-13 23:29:54 -07:00
James R. Barlow
b95eefc65f
Fix pikepdf version for Travis
2018-09-13 22:08:19 -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
3aac3a98ca
tests: Migrate metadata tests to pikepdf
...
For some reason PyPDF2 has begun to trigger internal errors in
pytest on macOS alone. Not sure why, but nothing is wrong that I can
see. Seemed like an opportune time to switch to pikepdf; found some
new issues in the process anyway.
2018-09-10 16:06:01 -07:00
James R. Barlow
268859a304
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF: docs
2018-09-10 11:52:04 -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
7077c8220a
Fix rst formatting in release notes
2018-09-10 11:46:17 -07:00
Mateus Seenem Tavares and jbarlow83
f7cbf68edd
Updating Arch Linux instalation ( #288 )
...
* Updating Arch Linux instalation
And adding a workaround to a wrong dependencies definition on https://aur.archlinux.org/packages/python-pikepdf/
* Remove comment about temporary workaround
2018-08-31 12:30:18 -07:00
James R. Barlow
68a58ee8a5
docs: fix hyperlinking of jbig2 page (again) and cleanup release notes
2018-08-27 01:25:30 -07:00
James R. Barlow
3109ec5091
v7.0.4 notes
2018-08-24 12:41:53 -07:00
James R. Barlow
e0599fe8d7
Require pikepdf 0.3.2
2018-08-24 12:41:43 -07:00
James R. Barlow
a749240589
docs: mention pikepdf install more clearly
2018-08-22 03:19:46 -07:00
James R. Barlow
6decdaa062
Try setuptools_scm_git_archive again
2018-08-20 15:45:51 -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
cf9a8a91b5
Require pikepdf 0.3.1
2018-08-10 16:59:08 -07:00
James R. Barlow
05d3a65e94
docs: Fix links to JBIG2 encoder page
...
[ci skip]
2018-08-09 21:14:50 -07:00
James R. Barlow
c043552f8b
Fix travis.yml syntax
2018-08-03 14:02:20 -07:00
James R. Barlow
487ee2b6c9
Notes for v7.0.2
2018-08-03 13:37:18 -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
4ec9ec12e3
docs: Describe PDF optimization
2018-08-03 13:10:18 -07:00
James R. Barlow
ed96594727
Regroup installation page content around platforms
...
Also separate out JBIG2 encoder instructions so that distributions that
delete installation.rst won't omit this information.
2018-08-03 12:47:25 -07:00
James R. Barlow
91b7193249
Travis: use xenial for Python 3.7
2018-08-03 11:52:23 -07:00
James R. Barlow
008f65c6a9
Update pinned requirements
2018-08-03 01:15:21 -07:00
James R. Barlow
7aa4e60af2
Explain pytest --runslow
2018-08-03 00:57:59 -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
55eb481f30
Add intensive (optional) rotation test
2018-08-03 00:42:59 -07:00
James R. Barlow
4509ca6e75
pipeline: remove unused function
2018-08-03 00:41:08 -07:00
James R. Barlow
c61fe9af61
Fix release notes typos
2018-08-03 00:40:44 -07:00
James R. Barlow
4181a712d1
Update setup.py for version changes
2018-08-01 15:17:49 -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
2669d8332e
Add more guidance about using Docker
2018-07-13 12:39:47 -07:00
James R. Barlow
11fbd32e6e
Merge v6.2.2 (mainly to get release notes)
2018-07-13 12:38:15 -07:00
James R. Barlow
6a302fdb88
Travis: nevermind xenial, then
...
Gave a weird build error
2018-07-12 03:27:40 -07:00
James R. Barlow
1d9cc239ee
Travis: Fix v6 build failures
2018-07-12 03:22:03 -07:00
James R. Barlow
d240fc1ea6
Update release notes for v6.2.2
2018-07-12 03:07:47 -07:00
James R. Barlow
e7d21dd826
Skip locale check on Python 3.7
2018-07-12 03:03:34 -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
5252b88f0f
Travis: modernize with v7.0.0 updates
...
Travis: add 3.7 testing
Travis: remove deploy to testpypi since it's broken
Travis: cherry-pick change to declarative APT
From efb9572
Removed pngquant
Travis: Remove linux_before_install.sh
Eliminate Homebrew autobrewing
2018-07-12 02:47:29 -07:00
James R. Barlow
ea69883386
Tests: Speed up a slow test (cherry-picked from v7)
2018-07-12 02:47:15 -07:00
James R. Barlow
eb343b1e37
Tests: Add ability to disable use of cache (cherrypicked from v7)
2018-07-12 02:46:53 -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
a12a5f11ff
More doc updates for 7.0.0
2018-07-12 01:52:49 -07:00
James R. Barlow
f46e4067f4
Dockerfile: should work now
...
[ci skip]
2018-07-11 00:57:20 -07:00
James R. Barlow
47bf5585e8
Dockerfile: needs leptonica
2018-07-11 00:17:04 -07:00
James R. Barlow
72fb4d39be
Dockerfile: fix missing mkdir
2018-07-10 21:56:49 -07:00
James R. Barlow
9681c0e05a
Eliminate Homebrew autobrewing
...
The Homebrew-core does such a good job of keeping things up to
date there is little to point to a private infrastructure.
2018-07-10 21:37:38 -07:00
James R. Barlow
2628575dab
Adjust Dockerfile again
2018-07-10 21:14:41 -07:00
James R. Barlow
f7d59068e5
Adjust Dockerfile for 7.0.0
2018-07-10 18:20:33 -07:00
James R. Barlow
4cf10d62ca
More work on installation steps
...
[ci skip]
2018-07-10 18:20:22 -07:00
James R. Barlow
2f65e3aac8
(Hopefully) fix build on ReadTheDocs
...
[ci skip]
2018-07-10 13:20:33 -07:00
James R. Barlow
e494cd7aa6
Update installation notes
...
Closes #276
2018-07-10 12:24:01 -07:00
James R. Barlow
809880f46d
Brew: jbig2dec and libffi are not required
2018-07-10 11:05:36 -07:00
James R. Barlow
5925ebe31c
Merge branch 'develop' (7.0.0) into master
...
# Conflicts:
# .gitignore
# .travis/linux_before_install.sh
# docs/release_notes.rst
# test_requirements.txt
2018-07-09 21:15:13 -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
1fcb06b1aa
Update readme
2018-07-09 14:02:12 -07:00
James R. Barlow
36138c7c06
Update release notes
2018-07-09 13:56:30 -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
d6eb1f9578
Remove dependency on private fork of ruffus, change to official 2.7
2018-07-09 12:51:56 -07:00
James R. Barlow
1cc9d2d3d1
Fix path error on Py3.5
2018-07-08 01:01:06 -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
James R. Barlow
7baaf00a38
Fix wrong return code tested
2018-07-05 13:49:22 -07:00
James R. Barlow
5cc23dbf24
pdfinfo: more robustness
2018-07-04 17:12:30 -07:00
James R. Barlow
216d60ea2c
pdfinfo: improve the regex
2018-07-04 00:59:32 -07:00
James R. Barlow
8b0496d35e
Fix invalid XML characters choking parser
2018-07-03 22:51:59 -07:00
James R. Barlow
e44001641c
Return a distinct error code if PDF/A fails
2018-07-03 16:59:03 -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
85f96b7fb0
Add test to optimize if jbig2 is present
2018-07-02 23:49:11 -07:00
James R. Barlow
890c7fd0f6
optimize: allow modification of quality settings in command line mode
2018-07-02 23:48:51 -07:00
James R. Barlow
39c44bdd2f
Don't use --optimize in test since jbig2enc is not always installed
2018-07-02 23:48:23 -07:00
James R. Barlow
5f99f7f6ca
Upgrade to Py3.7 locally and resolve a few issues
2018-07-02 23:47:51 -07:00
James R. Barlow
4f864bce98
Update macOS Brewfile
2018-07-02 22:25:46 -07:00
James R. Barlow
2974929b26
Make jpeg/png quality tunable args
2018-07-02 22:22:59 -07:00
James R. Barlow
db837aa55c
Improve release notes
2018-07-02 16:48:33 -07:00
James R. Barlow
7200623007
Fix installation for Python 3.7
...
Need to use private fork of ruffus for Python 3.7. Backward compatible with Python 3.6 for ruffus 2.6.3
Disable locale checking for 3.7 since the various fixes in that release should make it unnecessary.
2018-07-02 16:47:14 -07:00
James R. Barlow
73e02ae4ea
Hopefully workaround Py3.5 marshal error
...
https://github.com/eliben/pycparser/issues/251
2018-06-29 12:54:48 -07:00
James R. Barlow
d4cbef9457
Update test cache with naming rule change
2018-06-29 12:04:20 -07:00
James R. Barlow
ed8ff79e10
Optimize some of our bigger test files
...
Only partially optimize multipage.pdf so that it hopefully
improves speed of test suite without being useless as an
optimization test.
2018-06-29 00:35:49 -07:00
James R. Barlow
e725f64b6a
Add test case to ensure mono is not inverted
2018-06-29 00:25:11 -07:00
James R. Barlow
0029cc4fe7
optimize: fix PNGs that were reduced to 1-bit being inverted
...
At some point the color gets flipped, we have to flip it again,
for mono.
Incidentally this exposed an unused
optimization. Should change the
first past to scan all images and
record monochrome xrefs, then optimize
JPEG and PNG, possibly adding
mono images to the monochrome
queue. Finally, do JBIG2 optimization.
2018-06-29 00:09:20 -07:00
James R. Barlow
9637696a54
Fix test resources naming inconsistency
2018-06-28 23:37:14 -07:00
James R. Barlow
02b3ca6862
Compress test images more heavily
2018-06-28 21:40:12 -07:00
James R. Barlow
bc90f40a8f
Replace all Pix.read with Pix.open
2018-06-28 15:13:26 -07:00
James R. Barlow
3d727ff4c0
Fix leptonica remove_colormap was replaced with a no-op at some point
2018-06-28 15:11:51 -07:00
James R. Barlow
b0eacd6586
Add Python 3.7 support
2018-06-28 13:57:45 -07:00
James R. Barlow
7795701595
Merge branch 'test/ignore-masks'
2018-06-28 13:05:45 -07:00
James R. Barlow
bf214eecb3
Use newer pikepdf API for objgen
2018-06-28 12:59:01 -07:00
James R. Barlow
434b96d734
optimize: skip incremental images if any
...
These are fairly rare
2018-06-24 00:18:48 -07:00
James R. Barlow
b9dc109892
optimize: use new pikepdf api for objgen
2018-06-24 00:16:28 -07:00
James R. Barlow
1f40a70554
Use qpdf 8.0.2 backport, force old pytest-timeout to fix build
2018-06-23 03:14:18 -07:00
James R. Barlow
e14ffbf03f
v6.2.1 release notes
2018-06-23 03:01:54 -07:00
James R. Barlow
25a1dde57c
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:59:22 -07:00
James R. Barlow
bf96171b65
Ignore whether or not textonly_pdf was used in cache
...
The difference doesn't matter in 7.0.0 anymore.
2018-06-23 02:58:26 -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
b81daf71d1
Regenerate test cache
2018-06-23 02:02:58 -07:00
James R. Barlow
faad1fc58a
Reactivate two tests that weren't using their fixtures properly
2018-06-23 01:54:09 -07:00
James R. Barlow
6f48181a56
Disable a pylint
2018-06-23 01:53:04 -07:00
James R. Barlow
f1305e5a37
pdfa: fix function using closure when it shouldn't
2018-06-23 01:52:36 -07:00
James R. Barlow
f0e0f92776
leptonica: fix variables defined on class outside __init__
2018-06-23 01:51:55 -07:00
James R. Barlow
807c8b0726
Trailing whitespace
2018-06-23 01:51:19 -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
cd220d9ed9
pipeline: search_window variable not actually used
2018-06-23 01:48:57 -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
2530d1791b
Fix several pylint errors and warnings
2018-06-23 00:54:22 -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
54e74f84cc
Remove special of TypeError from ruffus
...
split_pages would still run if repair_pdf failed, for some reason.
Since we are no longer splitting pages this is vestigial.
2018-06-23 00:41:20 -07:00
James R. Barlow
76e7e8dbbb
Replace several uses of str(path) with fspath(path)
...
Helps make it more explicit. Did not do this to tests because use of paths
is more involved there.
2018-06-22 21:00:47 -07:00
James R. Barlow
324598e992
Remove helpers.universal_open()
...
This helper function only had a single usage, this was always an awkward
way to support Python 3.5 that I'd forget to use.
2018-06-22 17:56:20 -07:00
James R. Barlow
9e765ddf46
Rename _optimize to optimize.py
2018-06-22 17:51:57 -07:00
James R. Barlow
6ac9e92f17
Fix PEP8 docstring convention misuse in a few places
2018-06-22 17:51:25 -07:00
James R. Barlow
faaa4a1def
Ghostscript, PDF/A: support pathlib
2018-06-22 17:45:10 -07:00
James R. Barlow
0aa51f0f3a
Remove fitz from Travis
2018-06-18 15:38:41 -07:00
James R. Barlow
73431d9761
Remove obsolete _naive_find_text
2018-06-13 14:00:50 -07:00
James R. Barlow
45cb4525cf
Remove other references to PyMuPDF
2018-06-13 01:02:53 -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
1dfbbdebf4
Adjust for pikepdf API change
2018-06-08 22:47:56 -07:00
James R. Barlow
740918daee
Create debug envvar to override Creator or Producer
...
Note that Ghostscript always overrides Producer
2018-06-06 23:17:28 -07:00
jbarlow83 and GitHub
1d10eac764
Add wiki link to issue template
...
[ci skip]
2018-06-06 12:59:59 -07:00
jbarlow83 and GitHub
3f868118cd
Remove gpg
...
[ci skip]
2018-06-06 12:58:02 -07:00
James R. Barlow
04d79b15b4
optimize: fix error in Py3.5
2018-06-06 12:25:32 -07:00
James R. Barlow
a13c398c06
Suppress some spurious tesseract errors
2018-06-05 23:26:28 -07:00
James R. Barlow
e3b3f716ee
optimize: use tempdir for cmdline invocation
2018-06-05 21:20:54 -07:00
James R. Barlow
cf43c06f46
Use python-xmp-toolkit for xmp check
...
Eliminates PyPDF2 and defusedxml as dependencies.
2018-05-29 22:00:52 -07:00
James R. Barlow
74a5a18607
Tweak release notes
2018-05-28 14:52:06 -07:00
James R. Barlow
44241c6dd5
Travis: remove deploy to testpypi since it's broken
2018-05-27 01:49:18 -07:00
James R. Barlow
8fff496ffd
Fix Py3.5 not understanding os.path.exists(Path(...))
2018-05-26 22:55:22 -07:00
James R. Barlow
edf75c519c
Update v7 release notes
2018-05-26 02:08:49 -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
8ba4968c48
pdfinfo: more robustness
2018-05-26 01:54:25 -07:00
James R. Barlow
ffdd78f1a5
pdfinfo: Fix text_operators type not changed in related commit
2018-05-25 02:10:39 -07:00
James R. Barlow
ad9f8ca78e
pdfinfo: reinstate stack normalization for q/Q
2018-05-25 01:28:26 -07:00
James R. Barlow
78a686ecb4
Consider qpdf behavior on algo4 a pass
...
qpdf opens files with null user password, so do the same.
2018-05-25 00:33:31 -07:00
James R. Barlow
59e786eb3c
Remove old code to deal with single page only things
2018-05-25 00:32:55 -07:00
James R. Barlow
6d0461435f
Use OperandGrouper whitelist
2018-05-24 22:52:33 -07:00
James R. Barlow
0a04a60f69
Document need for pdfinfo to be pickleable
2018-05-24 22:24:13 -07:00
James R. Barlow
68d8642988
Found out this test was extremely slow - no reason to actual use a large file
2018-05-24 22:22:51 -07:00
James R. Barlow
16f70ff054
Main changeset for pikepdf-based refactor pdfinfo
2018-05-24 22:22:01 -07:00
James R. Barlow
c00aeafff0
Add scratch file
2018-05-24 22:20:15 -07:00
James R. Barlow
83f35e00f3
Start removing PyPDF2
2018-05-21 01:28:21 -07:00
James R. Barlow
786a2ad65a
Make optimize test do a little more
2018-05-18 17:50:39 -07:00
James R. Barlow
9425506c2a
Use pikepdf to handle paletted images
...
Removes all use of PyMuPDF in optimize
2018-05-18 17:44:29 -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
7b0a3ec365
Add notes for v7
2018-05-18 00:20:45 -07:00
James R. Barlow
083d442529
main: wording change
2018-05-18 00:20:24 -07:00
James R. Barlow
b52eb95cf8
optimize: use pikepdf to save PIL images
...
Eliminates another usage of PyMuPDF in the main path.
2018-05-18 00:18:44 -07:00
James R. Barlow
f4571e2508
Ensure we try compress anything that's not compressed when saving
2018-05-17 22:05:01 -07:00
James R. Barlow
b06ef03aac
pipeline: use the resolution of the OCR image rather than recalculating
...
(Recalculating would fail if the image is not centered.)
2018-05-17 16:51:53 -07:00
James R. Barlow
1d1962a106
weave: fix rescaling logic
...
rotation % 90 == 0 is always true.
2018-05-17 16:50:01 -07:00
James R. Barlow
4b98e9ff08
weave: if we don't have textonly_pdf, delete instruction to draw image
2018-05-17 16:49:20 -07:00
James R. Barlow
f83ca5d8ac
weave: whitespace
2018-05-17 16:06:36 -07:00
James R. Barlow
95cb4d22d7
pipeline: make /Info from indirect object as required
2018-05-17 16:06:13 -07:00
James R. Barlow
0c279b01a4
Fix test failure on missing JobContext
2018-05-17 01:16:58 -07:00
James R. Barlow
3b820ffa7b
test_metadata: change from xfail to skipif without fitz
2018-05-17 00:14:57 -07:00
James R. Barlow
35cb416563
pipeline: remove fitz-based attempt to repair table of contents
...
Prior to unsplit, if we were rebuilding the PDF we'd lose the
table of contents. With unsplit we keep the original file and patch
the table of contents as necessary, adn that works fine.
This remaining bit of code from PyMuPDF actually damages the
table of contents and removing it fixes the test suite. G'bye.
2018-05-16 23:24:57 -07:00
James R. Barlow
cdb737259c
pipeline: remove old page merge strategies
2018-05-16 22:16:54 -07:00
James R. Barlow
0843b5939c
pipeline: Move weave* to its own file
2018-05-16 22:08:31 -07:00
James R. Barlow
2b5f23a2d1
Add code to repair ToC with pikepdf
2018-05-16 21:39:23 -07:00
James R. Barlow
5e20d1d554
metadata: Fix failing test on __getitem__['/CreationDate']
2018-05-16 13:46:07 -07:00
James R. Barlow
18595ca86a
Use pikepdf for get_pdfmark
...
It does fine.
2018-05-16 12:24:35 -07:00
James R. Barlow
3e269fa188
Ubuntu 14.04 has a qpdf 8.0.2 backport, making life easier
2018-05-15 21:43:19 -07:00
James R. Barlow
65405c2cb9
Try getting qpdf from Ubuntu 18.04
2018-05-15 21:27:27 -07:00
James R. Barlow
442cf8897a
Travis: maybe upgrading wheel?
2018-05-15 18:12:35 -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
e60aec81ca
Travis: why can't we use qpdf appimage?
2018-05-15 16:59:16 -07:00
James R. Barlow
398e9e535e
optimize: Changed pikepdf API
2018-05-15 16:29:57 -07:00
James R. Barlow
08bf651ef2
Refactor JBIG2 path for non-CCITT monochrome images
2018-05-15 15:32:15 -07:00
James R. Barlow
6171de41bf
optimize: move a lot of image scanning code to pikepdf
2018-05-14 22:21:53 -07:00
James R. Barlow
f0a56592e2
Pull JobContext out of pipeline.py to avoid circular reference
2018-05-14 14:01:25 -07:00
James R. Barlow
87a7d4d1a8
Another fitz failure - incorrect object reference introduced
...
MuPDF/fitz changed some font references to point to table of contents
entries, corrupting the page. It no longer gets to save.
2018-05-14 13:58:49 -07:00
James R. Barlow
05287902a2
Travis: again
2018-05-13 11:02:25 -07:00
James R. Barlow
96e453feb6
Travis: Tweak setup so it can run
2018-05-13 01:21:24 -07:00
James R. Barlow
9c0fa9fc04
Travis: again
2018-05-13 01:17:04 -07:00
James R. Barlow
3bde0715b0
Move qpdf to before_script
2018-05-13 01:01:48 -07:00
James R. Barlow
e2ec3d8b9b
Travis: adjust qpdf appimage
2018-05-13 00:53:31 -07:00
James R. Barlow
ad91eaf8a7
Travis: try using qpdf appimage to speed up build
2018-05-13 00:42:48 -07:00
James R. Barlow
b6d30214fd
PyMuPDF 1.13.4 looks good, use it
2018-05-12 12:35:46 -07:00
James R. Barlow
c4ab01d63d
Fix "AttributeError: 'ImageInfo' object has no attribute '_type'"
...
Also deal with 'fixme' imagemask comment.
Also fix bpc incorrectly set to 8 by default on stencil masks.
2018-05-12 12:14:57 -07:00
James R. Barlow
4ba3b3f55a
Fix rotate_pages_threshold test failure
2018-05-12 11:47:46 -07:00
James R. Barlow
52d2706a9e
optimize: Fix error causing many images to be skipped
2018-05-12 01:37:30 -07:00
James R. Barlow
964afc69f6
leptonica: ErrorTrap is an implementation detail
2018-05-12 01:21:45 -07:00
James R. Barlow
3ddf545ccd
optimize: leptonica can fail to open PNG
...
ERROR - Info in pixReadStreamPng: converting (cmap + alpha) ==> RGBA
Error in pixReadStreamPng: spp == 1, cmap, trans array, invalid depth: 4
To investigate later....
2018-05-12 01:21:19 -07:00
James R. Barlow
f9374733bb
optimize: process ICCBased images that declare an /Alternate we recognize
2018-05-12 00:43:36 -07:00
James R. Barlow
5930135f45
optimize: Refactor naming helpers
2018-05-12 00:42:24 -07:00
James R. Barlow
f03f6bc128
optimize: document problem with transcode free compressed image data
2018-05-11 23:43:06 -07:00
James R. Barlow
6c50c70235
Try to optimize paletted images
2018-05-11 23:42:26 -07:00
James R. Barlow
8790fc2c1b
optimize: add knobs to control image quality but don't show the user yet
2018-05-11 23:41:49 -07:00
James R. Barlow
f86c4fccf4
optimize: don't alter >8 bpc images
2018-05-11 22:31:24 -07:00
James R. Barlow
7d0785e9ed
main: do better parameter validation
2018-05-11 22:31:09 -07:00
James R. Barlow
2cac88162c
Ignore masks when deciding what color to rasterize at
2018-05-11 21:27:57 -07:00
James R. Barlow
4809627d8a
Fix jbig2enc name
2018-05-11 17:51:08 -07:00
James R. Barlow
871979abd6
Temporarily unbreak without fitz mode
2018-05-11 17:32:15 -07:00
James R. Barlow
efb95722ca
Travis: Use declarative APT for Tesseract too
2018-05-11 12:46:10 -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
3254315127
Update test cache
2018-05-11 12:19:50 -07:00
James R. Barlow
ca297fd26b
Update tests
2018-05-11 02:33:44 -07:00
James R. Barlow
ac36a43cef
Warn about --user-words not having any effect
...
Might be available in full release of Tess4
2018-05-11 02:31:07 -07:00
James R. Barlow
f00183115d
Update our dependencies
2018-05-11 02:11:55 -07:00
James R. Barlow
161b29a899
Check jbig2 when optimizing is requested
2018-05-11 02:11:01 -07:00
James R. Barlow
72253d09fa
Add arguments to control optimization
2018-05-10 22:23:24 -07:00
James R. Barlow
40d09ddb23
Fix merge error in Leptonica
2018-05-10 21:17:47 -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
24b0adfacc
Merge branch 'master' into develop
2018-05-10 20:54:55 -07:00
James R. Barlow
acc6698ab3
Make XML metadata test actually work
2018-05-10 20:37:10 -07:00
James R. Barlow
606d3e6aa1
Remove tests that exercise obsolete features (tesseract, -g)
2018-05-10 20:33:32 -07:00
James R. Barlow
687a7954d6
test_main: uses leptonica
2018-05-10 19:05:31 -07:00
James R. Barlow
36a53a7b37
Weave: Unconditionally rotate and scale the text layerThis solves two issues. First, the text layer can end up being adifferent size, probably if the DPI is not an integer; scaling helps itfit slightly better. Second, other printable text on the page can end uphorizontally scaled or misaligned if we don't all of our drawing in aq/Q pair.
2018-05-10 19:03:31 -07:00
James R. Barlow
0a5982a902
PyMuPDF tweaks: don't clean
...
In MuPDF 1.13 clean might be unreliable, so explicitly don't do it,
even though it doesn't cause trouble in 1.12.
2018-05-10 18:50:52 -07:00
James R. Barlow
601863f9e9
Return to PyMuPDF 1.12.5
2018-05-10 18:47:10 -07:00
James R. Barlow
c9ce731119
Fix DPI mismatch between OCR page and source page
2018-05-10 17:34:08 -07:00
James R. Barlow
abed8e034e
Add metadata preservation test from stash
2018-05-10 16:43:28 -07:00
James R. Barlow
63032d304d
Revert "Since PyMuPDF 1.13.3 corrupts text, pin 1.12.5 and work around it"
...
This reverts commit b0ce7c63dd .
2018-05-10 16:27:17 -07:00
James R. Barlow
a57ecede78
Refactor textareas to remove duplicate code
2018-05-10 16:26:52 -07:00
James R. Barlow
b0ce7c63dd
Since PyMuPDF 1.13.3 corrupts text, pin 1.12.5 and work around it
2018-05-10 16:10:24 -07:00
James R. Barlow
d139a11c16
Weave: periodically save to prevent indefinite growth of open file list
2018-05-10 15:08:57 -07:00
James R. Barlow
aef043db0b
Revise parameter validation for output-type, pdf-renderer, lang
2018-05-10 14:53:22 -07:00
James R. Barlow
b8f3ead541
Remove tesseract renderer entirely
...
Grafting lets us work with older Tesseract versions as if they could use
sandwich, so there is no point in keeping it. It's been deprecated for a
long time now anyway.
2018-05-10 14:06:13 -07:00
James R. Barlow
e0bb898f29
Remove hocr debug renderer (-g)
...
The fact that this produces additional pages makes it a maintenance
burden. hocr can be debugged using hocrtransform.
2018-05-10 13:48:39 -07:00
James R. Barlow
45336c7c28
textareas: filter out images
2018-05-10 01:17:28 -07:00
James R. Barlow
20aabb2e83
When deciding if there is a text on a page, ignore the margins
...
Margins may include watermarks or digital stamps on otherwise
text-free pages.
2018-05-10 01:16:11 -07:00
James R. Barlow
1539e24d61
Ignore masks when deciding what color to rasterize at
2018-05-10 00:49:36 -07:00
Fabian Rodriguez and jbarlow83
c7cf041e4a
Fixed language option example (French) ( #266 )
...
Replace fre to fra.
2018-05-10 00:10:27 -07:00
James R. Barlow
da80d3f354
Add unconditional (for now) whiteout of text areas
2018-05-07 17:37:46 -07:00
James R. Barlow
001c8d7678
Upgrade PyMuPDF version
2018-05-07 16:24:26 -07:00
James R. Barlow
38ab03655b
Restore unpaper
...
It's a suggested/recommended dep not required in Deb/Ubu.
2018-05-06 21:36:12 -07:00
James R. Barlow
9226f8a5d1
Trap PDF/A-3 errors on old Ghostscript
2018-05-04 15:29:43 -07:00
James R. Barlow
5c8a007f3e
Fix failure to prevent use of Ghostscript on /UserUnit files
2018-05-04 13:34:34 -07:00
James R. Barlow
b3ad3e297d
v6.2.0 fixes
2018-05-03 17:04:23 -07:00
James R. Barlow
d607553e48
v6.2.0 Release notes
2018-05-03 16:47:21 -07:00
James R. Barlow
7cf83c77ca
Merge branch 'feature/pdfa3'
2018-05-03 16:45:57 -07:00
James R. Barlow
8a9f174f63
Fix XMP validation issue with /CreationDate
...
Related to previous validation issue. If the /CreationDate had no
timezone, Ghostscript also creates invalid metadata. Work around this.
Also fix up PDF date decoding, and transcode dates to standardize them.
2018-05-03 16:30:20 -07:00
James R. Barlow
98a0786c32
Add 18.04 update procedure
2018-05-03 13:55:16 -07:00
James R. Barlow
df1129724c
Update Dockerfile for Ubuntu 18.04
2018-05-03 01:27:13 -07:00
James R. Barlow
423cef08bf
Handle procset properly
2018-05-02 14:48:02 -07:00
James R. Barlow
04580accb4
Document aliasing of tesseract renderer
2018-05-02 14:47:38 -07:00
James R. Barlow
6376f77b8c
Refactor, remove trigonometry
2018-05-02 12:30:34 -07:00
James R. Barlow
e27e614ed9
Fixed rotation hard case
2018-05-02 01:32:11 -07:00
James R. Barlow
b0c04704a1
Fixed all but one rotation case
2018-05-02 01:24:21 -07:00
James R. Barlow
6bb6bf8323
Fix correction angle used from wrong page
2018-05-02 01:00:30 -07:00
James R. Barlow
e22fe8aefc
Silence debug messages
2018-05-01 23:51:54 -07:00
James R. Barlow
76276f61e5
Split out rotation related tests
2018-05-01 23:51:35 -07:00
James R. Barlow
bfd26e6ec6
Tests: confirm OCR layer copied
2018-05-01 23:16:41 -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
a9abe13185
Remove the old tesseract pdf_renderer
2018-05-01 17:31:34 -07:00
James R. Barlow
6b315e8315
Add ability to disable cache
2018-05-01 15:52:00 -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
c7387de325
Fix auto rotate
2018-05-01 15:18:28 -07:00
James R. Barlow
2495b1e038
Refactor find font, get test cases working again
2018-05-01 14:48:41 -07:00
James R. Barlow
073ee52ce7
Use hocr and weave; eliminate old combine layers and merge pages
2018-05-01 14:21:53 -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
e87a5776f1
Remove now-unnecessary code to rotate pages
...
Track only the decision to change rotation.
2018-05-01 13:01:25 -07:00
James R. Barlow
0806ce6406
Fix rotation for unsplit (modulo --rotate-pages)
2018-04-30 20:58:42 -07:00
James R. Barlow
6409894a71
feature/unsplit-try-imagerotate
2018-04-30 20:48:59 -07:00
James R. Barlow
e7286f6129
Unsplit now works with multipage, --force-ocr
2018-04-30 14:46:20 -07:00
James R. Barlow
2ab94b3151
unsplit: it's alive
...
First successful file output.
2018-04-28 01:57:41 -07:00
James R. Barlow
7ee90890ec
Add copying of essential information from Tesseract textonly
2018-04-27 23:19:08 -07:00
James R. Barlow
383e726d65
Expand size growth reasons to other arguments that trigger transcoding
2018-04-27 19:34:57 -07:00
James R. Barlow
e046f70642
Set OMP_THREAD_LIMIT unconditionally, for pngquant
2018-04-27 19:19:30 -07:00
James R. Barlow
2131ad4670
Fix --remove-background error on PDFs with colormapped images
...
It's unclear how exactly a
colormapped image gets to this
spot given the tendency of other
image processing tools to flatten
such images, but someone made it happen, so now we make sure
the image is okay.
Closes #262
2018-04-27 17:21:01 -07:00
James R. Barlow
219fe2155b
test_pageinfo: remove duplicate import
2018-04-27 17:16:42 -07:00
James R. Barlow
4209034d20
Add gpg key to issue template
2018-04-27 15:51:26 -07:00
James R. Barlow
abcae0c2a4
Fix helpers.py again
2018-04-25 22:10:51 -07:00
James R. Barlow
0934905493
Don't suppress error message from config_notfound
...
Since it showed up in s390x bionic
2018-04-25 21:58:18 -07:00
James R. Barlow
11cd6201d9
helpers: fix missing call to complain()
...
In practice this is probably unreachable.
2018-04-25 21:57:50 -07:00
James R. Barlow
8d2a917676
Page unsplit, development
2018-04-25 21:56:43 -07:00
James R. Barlow
44b4afa534
Begin conversion from page splititng to page markers
2018-04-23 22:57:50 -07:00
James R. Barlow
775be3933c
Cherrypick merge_pages unification
2018-04-20 23:08:15 -07:00
James R. Barlow
df87e21c85
Add support for PDF/A-3
...
No ability to attach files however
2018-04-20 00:06:55 -07:00
Hugo and jbarlow83
d761d80750
Use more standard __version__ rather than PILLOW_VERSION ( #257 )
2018-04-19 23:35:32 -07:00
James R. Barlow
8052019dde
optimize: fix reporting of jbig2 groups
2018-04-19 01:54:44 -07:00
James R. Barlow
a3d8950088
optimize: Don't save JPEGs if larger
2018-04-19 01:25:49 -07:00
James R. Barlow
004f5d3bf1
optimize: further improve decodeparms handling
2018-04-18 15:52:25 -07:00
James R. Barlow
f5d308a156
optimize: refactor tricky /Filter and /DecodeParms handling
2018-04-18 15:30:21 -07:00
James R. Barlow
3869996758
optimize: jbig2 error
2018-04-18 01:36:38 -07:00
James R. Barlow
cdb2107c4e
optimize: jbigs2 fix
2018-04-18 01:31:35 -07:00
James R. Barlow
4db2b3413b
optimize: more robustness
2018-04-18 01:25:34 -07:00
James R. Barlow
b2f31bec79
Make optimize a lot safer
2018-04-18 00:20:06 -07:00
James R. Barlow
78f9f4a266
Be more defensive about accessing
2018-04-18 00:11:39 -07:00
James R. Barlow
ad6087c342
optimize: more fixes
2018-04-17 23:58:10 -07:00
James R. Barlow
0d6ef430de
optimize: fix "length not defined"
2018-04-17 23:38:00 -07:00
James R. Barlow
a5942209e8
optimize: fix error on missing /Filter
2018-04-17 23:27:56 -07:00
James R. Barlow
9a60694cfc
optimize: ccitt header fixes
...
Changed to match TIFF spec's use of unsigned types, eliminated check for
/Columns.
There is some complex behavior for /Width != /Columns and
(/Width, /Columns) mod 8 != 0
that is not described well in the PDF spec.
2018-04-17 23:27:25 -07:00
James R. Barlow
4bf13f4737
optimize: be less chatty
2018-04-17 23:25:41 -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
1a516b2af9
Fix regression: time stamp test suite failures
2018-04-17 16:59:21 -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
5fde214290
Update notes for v6.1.5
2018-04-17 15:23:35 -07:00
James R. Barlow
a620724d6a
Fix PDF/A validation failure due to timezone being omitted from /ModDate
2018-04-17 15:16:48 -07:00
James R. Barlow
640b953ec7
Fix PDF/A validation failure due to timezone being omitted from /ModDate
2018-04-17 14:55:32 -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
7368399f8b
Clarify license of two test files - https://github.com/jbarlow83/OCRmyPDF/issues/254
2018-04-17 11:56:36 -07:00
James R. Barlow
c974aec934
Search for image masks too
2018-04-17 02:06:08 -07:00
James R. Barlow
3033f03f64
Iterate images with pikepdf / fix mono PNG corruption
...
To work around PNG corruption problem in PyMuPDF for monochrome images,
extract and save monochrome CCITT with synthetic TIFF header.
Works better but currently skips /ImageMask due to qpdf
implementation, which affects many files.
2018-04-17 01:50:37 -07:00
James R. Barlow
72723e0bb5
optimize: be quieter
2018-04-16 18:06:02 -07:00
James R. Barlow
2fb6ab3939
Trap writePNG error
2018-04-16 17:29:10 -07:00
James R. Barlow
25c1c160b8
Move optimize to new file
2018-04-16 17:22:06 -07:00
James R. Barlow
7e92895471
Parallelize pngquant
2018-04-16 12:37:51 -07:00
James R. Barlow
d291d48991
PNG palette: parse PDF string from leptonica instead
...
Seems better to accept whatever leptonica rather than make detailed
assumptions about how it encodes the palette.
Experimented with setting FlateDecode on the palette but it seems to
expand it.
2018-04-16 12:16:13 -07:00
James R. Barlow
0e6b8042b0
Implement PNG palettization
2018-04-16 11:18:52 -07:00
James R. Barlow
34c78a892a
Fix list table for tests/resources
...
[ci skip]
2018-04-15 23:52:19 -07:00
James R. Barlow
9d28879505
Update Ubuntu 14.04 instructions
...
Closes #252
2018-04-14 17:30:33 -07:00
James R. Barlow
2482296e2b
hocr: avoid division by zero
...
Issue #253 - PDF that produces the error is not available, but if font_width
is zero, chances are the text is nonprinting characters, so suppress it.
2018-04-14 17:24:21 -07:00
James R. Barlow
f755fb76ee
Try pngquant
2018-04-14 01:37:14 -07:00
James R. Barlow
c61b5dcb62
Fix PDF/A validation error from setting /Predictor 0
2018-04-14 01:36:46 -07:00
James R. Barlow
fae893b9d9
Reinstate transcoding of PNG
2018-04-14 00:19:24 -07:00
James R. Barlow
10aadefd6a
Document return codes
2018-04-14 00:18:58 -07:00
James R. Barlow
e75b6280fd
Try reading compressed data directly to see if Leptonica will add predictor
...
Turns out it does not transcode at all in this case, so probably going
to revert to transcoding PNG -> PNG. However if pngquant or similar is
done, this API will still be useful.
2018-04-13 23:55:23 -07:00
James R. Barlow
8c4023165a
Release L_COMP_DATA properly
2018-04-13 23:53:41 -07:00
James R. Barlow
b7d403f106
Deprecate Pix.read() behaving as an open function
2018-04-13 23:52:46 -07:00
James R. Barlow
b069de0caa
Use Leptonica to rewrite all PNGs with predictor
...
Leptonica does a better job of encoding them than Ghostscript, about -15%.
For a test file 450k worth of
PNGs was reduced to 388k with no loss of quality.
2018-04-13 16:35:50 -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
1f7837e7b1
v6.1.4 release notes update
2018-04-12 00:55:45 -07:00
James R. Barlow
ba0535e3fb
Update test cache to account for unpaper --layout none change
2018-04-12 00:48:21 -07:00
James R. Barlow
49fa7f6b5c
tesseract_cache: don't reveal host system file paths in manifest file
2018-04-12 00:47:28 -07:00
James R. Barlow
c95db246d4
v6.1.4 merge
2018-04-11 15:58:00 -07:00
James R. Barlow
1ba93371ce
docs: Update installation to reflect qpdf 7.0.0 requirement
2018-04-11 15:40:50 -07:00
James R. Barlow
fedbbdb575
Travis: compile qpdf from source
...
The older version in Travis's Ubuntu 14.04 can't pass the test suite anymore.
2018-04-11 15:40:45 -07:00
James R. Barlow
85ebba72bc
Fix setup.py syntax
2018-04-10 18:30:48 -07:00
James R. Barlow
b6cd436d5d
setup: Blacklist Pillow 5.1.0 on macos
...
https://github.com/python-pillow/Pillow/issues/3068
2018-04-10 18:15:37 -07:00
James R. Barlow
ec170c7e1e
Travis: use setup.py for requirements, don't override with .txt
2018-04-10 17:52:19 -07:00
James R. Barlow
f6399eb90f
optimize: use Leptonica to compact JPEGs
...
Pillow could do it too, but Leptonica is somewhat more PDF aware.
2018-04-10 17:45:05 -07:00
James R. Barlow
77f2448e59
Leptonica: add L_COMP_DATA compressed data manager
2018-04-10 17:44:03 -07:00
James R. Barlow
3d69b46fca
Release notes
2018-04-10 15:53:02 -07:00
James R. Barlow
4b6153ad18
Use defusedxml for XML parsing when reading XMP
2018-04-10 14:25:13 -07:00
James R. Barlow
75d37eb103
docs: expand ocr of image usage
2018-04-09 13:06:09 -07:00
James R. Barlow
11b6f77df0
unpaper: close images on error paths
2018-04-09 13:05:12 -07:00
James R. Barlow
db8b0319dd
get_version: repeat system error messages if the process exists with a signal
2018-04-09 13:04:51 -07:00
James R. Barlow
c9dd330766
JBIG2: refactor, don't recompress existing JBIG2
2018-04-09 13:04:10 -07:00
James R. Barlow
e40228102c
JBIG2: Streams created in this manner are already indirect objects
2018-04-06 17:11:17 -07:00
James R. Barlow
7889c6fb4c
Parallelize JBIG2 execution with thread pools
2018-04-06 17:00:23 -07:00
James R. Barlow
6eb1773110
Fix JBIG2Globals included multiple times in output
2018-04-06 17:00:03 -07:00
James R. Barlow
1d25823746
Implement functional, single threaded optimize
...
Passes verapdf
2018-04-06 15:49:16 -07:00
James R. Barlow
d1d4f1e198
Add issue links to release notes
2018-04-06 14:52:40 -07:00
James R. Barlow
709c01c7a1
Regroup three merge steps into a single step
...
All take the same inputs and deliver similar outputs, so it makes sense.
2018-04-06 01:07:02 -07:00
James R. Barlow
4a341c9034
Merge branch 'master' into feature/jbig2-2018
2018-04-05 21:29:39 -07:00
James R. Barlow
be41ff6d54
Update flowchart
...
[ci skip]
2018-04-05 21:26:37 -07:00
James R. Barlow
1dbb6f1746
Notes on relevant envvars, repology
2018-04-05 02:15:01 -07:00
James R. Barlow
753e6274ab
Tell unpaper to use --layout none so it won't blank out multi column text
2018-04-05 02:14:33 -07:00
James R. Barlow
7f462c618b
v6.1.3 notes
2018-04-03 00:11:20 -07:00
James R. Barlow
d8ac6e28ab
Convert monochrome images to JBIG2
...
Awkwardly using fitz and pikepdf, transcode monochrome to CCITT.
This requires _OCRMYPDF_NO_FITZ=1.
00000x.opt.pdf can be checked for JBIG2 to confirm, but this file is
not passed to the output since it's not all wired up yet.
2018-04-03 00:00:53 -07:00
James R. Barlow
a95ffcdc46
Experimental add jbig2
...
It appears that fitz forces conversion of jbig2 to ccitt no matter what,
so pikepdf will be needed to patch jbig2 images.
2018-04-03 00:00:53 -07:00
James R. Barlow
1b01d45dd2
Warn about Python 3.5 page count issue
2018-04-02 19:29:17 -07:00
James R. Barlow
7a1cd39b21
Fix creation date metadata lost from input
...
Closes #247
2018-04-02 17:53:39 -07:00
James R. Barlow
1c1fd9616a
Don't depend on pytest-xdist in setup.cfg
2018-04-02 11:45:03 -07:00
Sean Whitton and jbarlow83
11e19e4085
remove addopts key from tool:pytest section of setup.cfg ( #246 )
...
The '-n' command line argument is not supported by recent pytest.
2018-04-02 14:43:38 -04:00
James R. Barlow
2a43f73228
Update installation.rst, further info on fitz
2018-04-02 11:32:57 -07:00
James R. Barlow
b1d1310a75
Dockerfile: use fitz
2018-04-02 11:08:03 -07:00
James R. Barlow
0e7fa78e65
Remove inaccurate statement from setup.py
2018-04-01 13:20:17 -07:00
James R. Barlow
4032570d97
Change docs for fitz/PyMuPDF
2018-04-01 13:19:57 -07:00
James R. Barlow
90644a3017
pipeline: refactoring, use with block for images
2018-03-31 13:26:40 -07:00
James R. Barlow
4f6bffb477
Update copyrights
2018-03-31 11:54:38 -07:00
James R. Barlow
158f902c3b
Fixed setup.py syntax error
2018-03-30 14:00:36 -07:00
James R. Barlow
6dc25ddc6e
v6.1.2: add license to wheels, depend on defusedxml
2018-03-30 13:22:35 -07:00
James R. Barlow
7f6aaeaecf
v6.1.2
2018-03-30 12:39:33 -07:00
James R. Barlow
ace439910e
Remove PyMuPDF 1.12.4 shim
2018-03-30 12:33:27 -07:00
James R. Barlow
7f038568de
Add envvar to ease testing without PyMuPDF
2018-03-30 12:32:48 -07:00
James R. Barlow
af777c0b6a
Test macos without fitz too
2018-03-30 00:13:09 -07:00
James R. Barlow
fc299032a4
v6.1.1 release notes
...
Better get the last one out
2018-03-30 00:11:52 -07:00
James R. Barlow
e0f3f07907
Fix text reported as found on all pages when PyMuPDF is not available
2018-03-30 00:10:53 -07:00
James R. Barlow
b36df9cf9e
pdfa: codecs.encode -> hexlify (simpler)
2018-03-29 22:17:23 -07:00
James R. Barlow
81c3f780d4
Travis: Should test 3.6 Linux without fitz too
2018-03-28 23:54:43 -07:00
James R. Barlow
b51efdd3e3
Travis: don't upload to legacy PyPI anymore, it will stop working soon
2018-03-28 23:40:29 -07:00
James R. Barlow
610b769df9
Update release notes
2018-03-28 23:33:34 -07:00
James R. Barlow
527f4d0101
Workaround fitz not escaping parentheses
...
Closes #239
2018-03-28 23:23:34 -07:00
James R. Barlow
8d9be43c60
test_bookmarks_preserved won't raise ImportError any more
...
Due to trapping this in ocrmypdf.lib
2018-03-28 23:22:55 -07:00
James R. Barlow
40ef4f0bbe
Add new argument --skip-repair to skip the repair step
2018-03-28 00:54:58 -07:00
James R. Barlow
d0271d5049
More debug messages on repair; update notes
2018-03-28 00:39:38 -07:00
James R. Barlow
5becfcf8ea
Refactor fitz ImportError trap
2018-03-27 21:38:02 -07:00
James R. Barlow
112e8d6c18
Fix regression: PDF/A broken without fitz
2018-03-27 21:33:10 -07:00
James R. Barlow
1d8d49a01d
Add PyMuPDF to preamble
2018-03-27 21:32:38 -07:00
James R. Barlow
5050155685
Add warning for large file size increases
2018-03-27 15:49:16 -07:00
James R. Barlow
a9bd494cc0
Merge branch 'optional-fitz'
2018-03-27 13:36:33 -07:00
James R. Barlow
6a4df78bc0
Add _naive_find_text to search for text when fitz is not available
2018-03-27 13:36:17 -07:00
James R. Barlow
530eae3898
Fix test_main missing file_claims_pdfa
2018-03-26 15:33:53 -07:00
James R. Barlow
3e444f6a90
Make fitz optional
2018-03-26 13:22:09 -07:00
James R. Barlow
45dbff6401
Fix table of contents not preserved in PDF/A
2018-03-26 02:23:19 -07:00
James R. Barlow
bc56b8e058
Move metadata tests to new test_metadata
2018-03-26 01:49:25 -07:00
James R. Barlow
d86e315c48
v6.0.1 start release notes
2018-03-26 01:44:01 -07:00
James R. Barlow
746969207a
Remove deprecated --pdf-renderer tess4, which was renamed to sandwich
...
Should have been cut in v6.0.0
2018-03-26 01:17:22 -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
2d10fdcf0f
Fix typo in release notes
2018-03-25 21:37:06 -07:00
James R. Barlow
355ec70a80
Note other web frontends
2018-03-25 21:36:39 -07:00
James R. Barlow
a2f499de01
Remove pageinfo.py which release notes said was gone for v6
2018-03-25 12:16:56 -07:00
James R. Barlow
f4bca89722
Remove Tesseract 4 message
2018-03-25 12:16:31 -07:00
James R. Barlow
9fbc69df3f
v6.0.0 release
2018-03-25 01:34:26 -07:00
James R. Barlow
230d301268
conftest: py3.5 path issue
2018-03-25 00:52:45 -07:00
James R. Barlow
1ce7b02d94
Travis: don't cache tests/cache anymore, you get it with git
2018-03-25 00:52:19 -07:00
James R. Barlow
a2d00f5f1d
tess cache: fix tess3 error for -psm instead of --psm
2018-03-25 00:43:02 -07:00
James R. Barlow
f68eaa3b46
Fix PyMuPDF version for Travis
2018-03-25 00:36:26 -07:00
James R. Barlow
0199ab220e
Tweak Manifest and .travis once more
...
Travis "do_not_include" moving around no longer needed, thankfully.
Manifest needed LICENSE.
2018-03-25 00:19:45 -07:00
James R. Barlow
656045610a
Update release notes
2018-03-25 00:17:23 -07:00
James R. Barlow
8c1c61f207
test cache: fix Path + str error
2018-03-25 00:02:03 -07:00
James R. Barlow
af085b79dd
Move ocrmypdf to src/ocrmypdf
2018-03-24 23:59:08 -07:00
James R. Barlow
77476965ae
test cache: use .bin extension, fix .gitignore .gitattributes
2018-03-24 23:54:16 -07:00
James R. Barlow
961c1365f9
Update manifest.in
2018-03-24 23:50:58 -07:00
James R. Barlow
ca51514046
Add test cache
2018-03-24 23:50:41 -07:00
James R. Barlow
8975b72a01
Fix test_testonly_pdf generating an output file in pwd
2018-03-24 22:34:35 -07:00
James R. Barlow
874ec6a87f
Add missing fixture to test_unpaper
2018-03-24 22:24:14 -07:00
James R. Barlow
909eaeeead
spoof: Allow tesseract cache to share cache
...
Previous incarnation was only suitable for generating a local cache
where the suite was executed repeatedly. Now the cache ignores
differences, so it can be checked into Github and shared.
2018-03-24 22:17:36 -07:00
James R. Barlow
c138161fae
Tests: more cleanup
2018-03-24 15:35:57 -07:00
James R. Barlow
e48590d66c
Refactor out unpaper-specific tests
2018-03-24 15:21:44 -07:00
James R. Barlow
5b1c8541fc
Review some skipped tests to make sure reasons still valid
2018-03-24 15:13:23 -07:00
James R. Barlow
e5e011021b
Remove the OCRMYPDF_program environment variables
...
Really, this was just replicating the functionality of the PATH
environment variable, and users probably do that anyway.
2018-03-24 15:09:08 -07:00
James R. Barlow
11d74dea09
Remove the OCRMYPDF_program environment variables
...
Really, this was just replicating the functionality of the PATH
environment variable, and users probably do that anyway.
2018-03-24 15:07:02 -07:00
James R. Barlow
cbdf9c88c5
Update requirements
2018-03-24 14:03:34 -07:00
James R. Barlow
46601b1350
setup: skip 1.12.4.1 since it does not provide wheels
2018-03-24 02:59:58 -07:00
James R. Barlow
6f1a40b2ca
v6.0.0 notes, build machinery changes
2018-03-24 02:52:56 -07:00
James R. Barlow
a2b1f54eb2
Update documentation license info
2018-03-24 02:33:24 -07:00
James R. Barlow
6756016572
Add license notice to all files
...
Source files to GPL3
Exceptions:
-tests/spoof/* to MIT
-hocrtransform.py
-_unicodefun.py
Test resources to CC BY-SA 4.0 except when otherwise noted.
Add GPL license.
2018-03-24 02:33:24 -07:00
James R. Barlow
f42123afc3
pipeline: make removal of merge_qpdf more explicit
2018-03-24 02:30:05 -07:00
James R. Barlow
1425ffd274
pipeline: Merge branch 'feature/mumerge' into test
...
Replaces qpdf page merging
2018-03-24 02:26:01 -07:00
James R. Barlow
d700154e0e
Fix regressions after --skip-text improvements
2018-03-24 02:24:45 -07:00
James R. Barlow
efecf42566
Add PyMuPDF and use to detect text on pages
2018-03-24 02:16:53 -07:00
James R. Barlow
74bdfc07fb
mumerge: fix regressions
2018-03-24 01:18:22 -07:00
James R. Barlow
376dfdba1c
Fix text/image files not closed in combine_layers
2018-03-23 13:48:37 -07:00
James R. Barlow
3795d6720f
Try out pymupdf merging
...
With garbage collection it reduces waste on the worst case file.
That's nice. 1 MB -> 105 MB -> 1.5 MB.
Indicates really problem is using PyPDF2 to watermark.
Currently hacked into --output-type pdf.
2018-03-23 13:39:16 -07:00
James R. Barlow
537aaf56d7
Remove duplication between page merge functions
2018-03-23 13:38:53 -07:00
James R. Barlow
34d51b5d3d
Merge branch 'feature/faster-split'
2018-03-23 13:10:53 -07:00
James R. Barlow
dea8fcfb5b
Optimize page splitting by multiprocessing
...
Previously page splitting occurred in a single process because it was
not believed to affect performance much. It turned out to be an expensive
operation.
It now scales better with large page sizes although this has a negative
effect on small files.
Overall time changes as follows:
7 page file, 9.02s -> 9.56s
731 page file, 213s -> 97s
WITH --tesseract-timeout 0 --output-type pdf --skip-text
i.e. you don't get a 2.2x speed gain when OCR is available.
Squashed a commit to ix test suite failure on --rotate-pages
Squashed a commit to remove debug code
2018-03-23 13:07:51 -07:00
James R. Barlow
4f1f3b9b51
Move available_cpu_count to helpers
2018-03-23 13:07:51 -07:00
James R. Barlow
dfeb8812ad
Document some instances of 0 vs 1-based page numbering, import cleanup
2018-03-23 13:07:31 -07:00
James R. Barlow
63e2b4273a
Travis: avoid using set -e since it interferes with Travis
...
https://github.com/travis-ci/docs-travis-ci-com/issues/1672
2018-03-23 12:49:12 -07:00
James R. Barlow
5790dbc085
Merge commit '9e2105e08d5fc765dbf636d108809bb66ab562a5'
2018-03-20 18:15:57 -07:00
jbarlow83 and GitHub
9e2105e08d
Update readme shields
...
Drop Docker Hub for now, add homebrew
2018-03-20 17:16:28 -07:00
James R. Barlow
22582bbd1c
Travis: don't trigger Docker Hub anymore
...
Docker Cloud is set up to build on pushes to master and tagged releases.
Hopefully that will work out.
2018-03-19 21:09:31 -07:00
James R. Barlow
e5f27b7a12
Solve text detection issue with PyMuPDF
2018-03-15 22:29:56 -07:00
James R. Barlow
e88ec9822b
Tweak release notes
2018-03-15 17:09:43 -07:00
James R. Barlow
5ffd2f5c96
Not ending Py3.5 support just yet
2018-03-15 17:06:11 -07:00
James R. Barlow
11fdb4c5d8
Update release notes for v5.7.0
2018-03-15 17:06:04 -07:00
James R. Barlow
319aff6d09
Merge better-hocr
2018-03-15 16:59:59 -07:00
James R. Barlow
a614fa3400
hocr: simplify some math expressions and add comments
2018-03-14 17:05:40 -07:00
endolith and jbarlow83
8d691391ac
Fix typos in advanced.rst ( #228 )
2018-03-14 15:54:55 -04:00
James R. Barlow
0089a84c94
hocr: Make interword spaces default and non-optional for hocr
...
Update documentation to match.
2018-03-13 14:51:47 -07:00
James R. Barlow
90676e1c6a
hocr: Remove baseline dashes
2018-03-13 14:45:31 -07:00
James R. Barlow
062901be43
Some cleanup and variable renaming
2018-03-13 14:29:22 -07:00
James R. Barlow
b195d79b50
Refactoring
2018-03-13 11:04:34 -07:00
James R. Barlow
6d7ee98721
Force Tesseract 4 to be single threaded
...
Gives better performance (throughput basis) than the existing solution
and scales better on powerful boxes.
2018-03-13 08:54:52 -07:00
James R. Barlow
fc0800ed5d
v5.6.3 notes
2018-03-12 03:41:12 -07:00
James R. Barlow
f4e3a0e5b2
v5.6.2 notes
2018-03-09 15:37:08 -08:00
James R. Barlow
d631c80024
Suppress debug message when merging large files
2018-03-09 11:10:45 -08:00
James R. Barlow
f1f0033875
Suppress spurious debug message in --output-type pdf
2018-03-09 11:07:28 -08:00
James R. Barlow
84d120e850
v5.6.1 notes
2018-03-09 08:00:42 -08:00
James R. Barlow
8159cc6b88
Skip one test that fails for qpdf 8.0.[0,1], due to qpdf regression
2018-03-09 07:57:22 -08:00
James R. Barlow
995f8c106b
hocr: account for baseline offset to position text more accurately
2018-03-09 07:45:41 -08:00
Jim Barlow
7cc104b138
hocr: account for skewed baseline
2018-03-05 11:16:40 -05:00
James R. Barlow
b3a7299a62
hocr: refactor/improve PEP8 a bit
2018-03-05 10:47:36 -05:00
James R. Barlow
0e7a4deaec
hocr: add baseline function, hocr doc link
2018-03-05 10:47:36 -05:00
James R. Barlow
b4d66650bd
hocr: adjust text cursor with relative moves
2018-03-05 10:47:36 -05:00
James R. Barlow
4986afca28
hocr: Refactor use of text object
...
We don't need to declare the font on each word.
No improvement for removing trailing space or adding \n
2018-03-05 10:47:36 -05:00
James R. Barlow
2b6004a82b
hocr: Make words on line use the line height
...
Seems to improve the behavior and appearance
of selected text a fair bit.
2018-03-05 10:47:36 -05:00
James R. Barlow
04c54a7c31
Suppress spurious debug message in --output-type pdf
2018-03-05 10:47:36 -05:00
James R. Barlow
7ae6c5ae87
Trial merge interword-spaces
2018-03-02 23:47:06 -08:00
James R. Barlow
4046766ca5
Fix Python 3.5 test suite failure on symlinks
...
Did not account for API difference in pathlib
2018-03-02 16:57:46 -08:00
James R. Barlow
810390df0b
pipeline: Refactor duplicate with clause
2018-03-02 16:57:15 -08:00
James R. Barlow
de749bc7ae
Fix regression - output to stdout broken
2018-03-02 15:35:51 -08:00
James R. Barlow
9965b8800c
Move Dockerfiles out of the way
2018-03-02 15:26:41 -08:00
James R. Barlow
ab870fddd6
Dockerignore: glob supported now
2018-03-02 15:24:42 -08:00
James R. Barlow
a79d6807cf
Dockerfiles: remove deprecated MAINTAINER tag
2018-03-02 15:24:28 -08:00
James R. Barlow
8185fb7e43
Migrate Travis CI setup to Brewfile
2018-03-02 15:16:05 -08:00
Tucker Barbour and jbarlow83
4b10929b25
Fix Homebrew python package ( #227 )
...
Homebrew removed python3 and python now defaults to version 3. Here we
use `brew upgrade python` to upgrade the pre-installed version of
python to python3.
2018-03-02 14:59:23 -08:00
Tucker Barbour
f6c70312c9
Fix Homebrew python package
...
Homebrew removed python3 and python now defaults to version 3. Here we
use `brew upgrade python` to upgrade the pre-installed version of
python to python3.
2018-03-02 14:26:13 +00:00
Tucker Barbour
9fd9c7a51f
Scale BoundingBox and Text elements to account for additional space.
...
Here we are manually scaling the pt width used for the BoundingBox and
the Text element when manually adding whitespace to account for
limitations of the PDF.js viewer. This fixes an initial regression
noticed when selecting text elements in Chrome and PDFium. The width
of the Text element and BoundBox had not been adjusted for the
additional whitespace so the highlighting was offset slightly.
2018-03-02 11:18:47 +00:00
Charles Forcey
422e619978
Add a note to the documentation about interword-spaces
2018-03-01 13:15:03 -05:00
Tucker Barbour and Charles Forcey
e6e34251c6
Add option to explicitly add interword spaces to HOCR pdf-renderer
...
This commit includes an optional work around for limitations of the
PDF.js viewer described in
https://github.com/jbarlow83/OCRmyPDF/issues/133 . Here is explicitly
add an addition space to text elements before drawing them on the PDF
canvas when using the HOCR renderer. This option does not apply to
other pdf renderers in OCRmyPDF and is turned off by default.
2018-03-01 13:15:03 -05:00
James R. Barlow
2d8aad1086
Improve docs
2018-03-01 00:24:38 -08:00
James R. Barlow
74ca736333
Issue #223 : improve text of encrypted PDF error message
2018-02-27 15:08:22 -08:00
James R. Barlow
5e4fd8b0b9
compile_leptonica should have shebang
2018-02-24 12:49:36 -08:00
James R. Barlow
8ab8132411
lint: unused variables, wildcard imports
2018-02-24 12:48:52 -08:00
James R. Barlow
6899dd46e4
lint: remove extraneous backslash
2018-02-24 12:42:37 -08:00
James R. Barlow
8ad0697a20
lint: remove duplicate property definition
2018-02-24 12:42:03 -08:00
James R. Barlow
b47e5672e6
Remove old test case that no longer works
2018-02-24 12:40:14 -08:00
James R. Barlow
45c7bd9a60
lint: Remove shebangs from non-executable files
2018-02-24 12:38:58 -08:00
James R. Barlow
e7bcb95635
Fix pylint errors
2018-02-24 11:59:01 -08:00
James R. Barlow
3de83627a9
Handle output to /dev/null or directory ( #219 )
...
Previously we threw an exception if the output name was a directory (only after doing OCR) and would trigger a PermissionError on trying to flip permission bits of /dev/null due to shutil.copyfile implementation. Instead of copying file use shutil.copyfileobj which should also respect umask etc.
2018-02-19 22:15:07 -08:00
James R. Barlow
f248576994
Change instructions to point away from private tap
2018-02-19 17:33:58 -08:00
James R. Barlow
aac5b6de3b
Update autobrew script to match final changes
2018-02-17 00:12:03 -08:00
James R. Barlow
24435f11e0
We are now in homebrew
2018-02-15 17:42:16 -08:00
James R. Barlow
a9da839c39
Add vector-only PDF test case
2018-02-08 00:17:35 -08:00
James R. Barlow
fa2c0296d6
v5.6.0 release notes, docs
2018-02-07 16:48:04 -08:00
James R. Barlow
1dfc32d7e6
Preserve "text as curves" vector content
...
Never updated the checking logic to deal with a pure vector file with no text that needs an OCR layer. This is doable, so allow it.
2018-02-07 16:05:48 -08:00
James R. Barlow
4a61beae41
autobrew: use homebrew's built-in test fixture
2018-02-05 11:10:33 -08:00
James R. Barlow
bd30587bf1
Update depends_on order
2018-01-29 13:16:07 -08:00
James R. Barlow
e0070e3e18
Update Dockerfile to use Ubuntu 17.10 (issue #214 )
2018-01-28 15:30:41 -08:00
James R. Barlow
019513696b
Ghostscript spoof scripts did not report their --version correctly
2018-01-10 17:08:14 -08:00
James R. Barlow
ad7a4476db
hugemono.pdf needs --max-image-mpixels to pass with Pillow 5.0
2018-01-10 16:55:18 -08:00
James R. Barlow
4812b20fb2
Fix tesseract_noop.py generating wrong size of output PDF in tests
...
This caused trouble before with test_deskew
2018-01-10 16:35:31 -08:00
James R. Barlow
f5e07c9427
Fix Ghostscript parameter order
2018-01-10 16:33:26 -08:00
James R. Barlow
75dcb90621
Niceties: when environment variable overload is used clarify we're not checking the PATH
2018-01-10 16:33:03 -08:00
James R. Barlow
dfc0434cc2
Update requirements to set Pillow to 5.0
2018-01-10 15:45:23 -08:00
James R. Barlow
882fc2257c
Add --max-image-mpixels argument to support Pillow 5.0
2018-01-10 15:43:59 -08:00
James R. Barlow
41e83b52fc
Document process for redoing OCR
2018-01-10 15:39:58 -08:00
James R. Barlow
47758b4d8f
Reactivate autobrew
2018-01-10 15:39:36 -08:00
James R. Barlow
6bf1f970a0
Fix some parameter validation for --output-type pdfa-1 and pdfa-2
2018-01-10 11:50:08 -08:00
James R. Barlow
7d451f101f
Detect old versions of Ghostscript and warn about them ( #208 )
2018-01-10 11:47:39 -08:00
James R. Barlow
7edbfe0e40
Update autobrew template
2018-01-09 12:36:14 -08:00
James R. Barlow
91b42cbfa8
Fix issue in sandwich renderer when skipping OCR on a rotated and deskewed page
...
If OCR is skipped due to --tesseract-timeout or similar, and the skip page is rotated with /Rotate, and the skip page was deskewed or had other image processing, then the skip page was created with the wrong dimensions causing the output page to be cropped.
2018-01-09 00:17:53 -08:00
James R. Barlow
6907df41b4
Disable autobrew until homebrew accepts the official release
2018-01-08 23:26:58 -08:00
James R. Barlow
2cebd90cbd
Fix brew audit --strict warnings
2017-12-09 12:14:28 -08:00
James R. Barlow
376a121aaa
Re-enable macos
2017-11-29 15:06:19 -08:00
James R. Barlow
da11fd17ee
qpdf dummy: needs to return version now
2017-11-29 14:35:37 -08:00
James R. Barlow
a40689a0ff
tesseract: handle return of bytes properly in error cases
2017-11-29 14:35:26 -08:00
James R. Barlow
44a45fc3fb
Add "bad UTF8 output from Tesseract" test
2017-11-29 14:08:07 -08:00
James R. Barlow
ec4bb5359a
Read tesseract's output as binary to avoid UnicodeDecodeErrors if it messes up
2017-11-29 13:44:40 -08:00
James R. Barlow
d2217632df
Rename _verify_python3_env
2017-11-29 13:43:18 -08:00
James R. Barlow
2cc044feed
Move qpdf complaint to after options checking so that it won't break ocrmypdf --version
2017-11-29 13:42:55 -08:00
James R. Barlow
64fd0cb54f
Remove test_qpdf.py only from travis
2017-11-29 12:54:48 -08:00
James R. Barlow
c5a1d22e81
That fixed it. Complain about old versions of qpdf now
2017-11-29 12:53:34 -08:00
James R. Barlow
a7b307af04
Looks like issue was negzero.pdf with qpdf 5.1.1 on travis, which is why osx passes
...
Reorganize and see if this is better now
2017-11-29 12:47:09 -08:00
James R. Barlow
3269eba16c
Is it negzero.pdf?
2017-11-29 12:02:37 -08:00
James R. Barlow
d472860e3b
Try to diagnose travis-only failure of qpdf test
2017-11-29 11:41:06 -08:00
James R. Barlow
731c9ea55e
Set timeouts on the tests that seem to be stalling on travis (but not elsewhere)
2017-11-27 14:46:10 -08:00
James R. Barlow
0b6af8d965
Clarify hocrtransform license/copyright
2017-11-27 13:41:46 -08:00
James R. Barlow
92ca9e954c
Fix test warning/failures, hopefully
2017-11-27 13:41:32 -08:00
James R. Barlow
67aa00e2c5
Remove py3.5 deprecation
...
It'll be in Debian stable for a long time, so maybe not such a good idea
2017-11-27 01:10:34 -08:00
James R. Barlow
a1bf161eb7
Update v5.4.4 release notes
2017-11-27 01:09:35 -08:00
James R. Barlow
56614fcaa4
Add support and tests for handling page count > ulimit - fixes issue #181
2017-11-27 00:32:35 -08:00
James R. Barlow
4d9169e15f
Add merge ulimit test case
2017-11-26 23:34:36 -08:00
James R. Barlow
3a167af2c4
Nearly smallest possible PDF-1.3 with all required fields
2017-11-26 23:32:21 -08:00
James R. Barlow
64b9005030
v5.4.4 release notes; mention deprecation of 3.5
2017-11-26 23:08:55 -08:00
James R. Barlow
965de3a235
Test case for issue #200
2017-11-26 22:52:53 -08:00
James R. Barlow
2040ae4856
Fix issue #200 , uncommon but valid decimal syntax treated as error
...
Also replace check_output() calls with run() in qpdf.py
2017-11-26 22:52:43 -08:00
James R. Barlow
31a1f9f5ea
pytest-runner should be a setup requirement
2017-11-26 22:51:51 -08:00
James R. Barlow
7eadd82048
Update docker script based on uid issue
...
issue #180 , fix reported by @Atredis76
2017-11-26 15:11:17 -08:00
James R. Barlow
31d0eaac8e
Ensure intermediate metadata holder PDF has same version as its input file
...
While not known to cause problems, the absence of this could confuse parsers
2017-11-24 00:09:13 -08:00
James R. Barlow
f45d012635
Update docs: security, pip install --user
2017-11-21 16:50:14 -08:00
James R. Barlow
5a777ee9bc
v5.4.3 release notes
2017-11-17 02:28:02 -08:00
James R. Barlow
7bbf6bc7f4
Travis didn't like LANG, use LC_ALL
2017-11-16 20:37:30 -08:00
James R. Barlow
9bfc45702d
Update copyright in license
2017-11-16 17:18:29 -08:00
James R. Barlow
40aa82ab41
Check that the locale is sane before allowing OCR to proceed
2017-11-16 17:18:02 -08:00
James R. Barlow
5d2c67c62b
Declare in yet another place that this shouldn't run on py2
2017-11-16 14:54:28 -08:00
James R. Barlow
a00ef4836d
autobrew: declare conflict with mactex
...
As reported in https://github.com/jbarlow83/homebrew-ocrmypdf/issues/4#issuecomment-345029899
2017-11-16 14:53:42 -08:00
James R. Barlow
3ef766bb93
Remove bare 'except:'
2017-11-01 01:52:13 -07:00
James R. Barlow
44b5a18462
Declare our __version__ properly
2017-11-01 01:49:51 -07:00
James R. Barlow
4df716f0e8
Update requirements.txt
2017-11-01 01:49:35 -07:00
James R. Barlow
fcbf34a4d3
Refactor obtaining version from subprocesses
...
Issue #196 raised the need to deal with linker warnings on --version.
2017-11-01 01:44:36 -07:00
James R. Barlow
c7b8b6e18b
Fix issue #194 - --sidecar creates blank txt file
2017-10-26 18:15:31 -07:00
James R. Barlow
9fd165bf4b
Add 'zlib' to travis recipe
2017-10-26 18:06:12 -07:00
James R. Barlow
2061092ec5
Describe how to stream with Docker
...
[ci skip]
2017-10-18 12:37:27 -07:00
James R. Barlow
57466a31ba
v5.4.1 release notes
2017-10-12 14:04:45 -07:00
James R. Barlow
4213c69bef
Try to make travis actually deploy macOS
2017-10-12 12:45:40 -07:00
James R. Barlow
cc5578488a
Remove workaround for OSD crash and use explicit -l osd
...
Suggested by amitdo in https://github.com/tesseract-ocr/tesseract/issues/1167
2017-10-12 12:45:18 -07:00
James R. Barlow
4b7135f0e5
Add option to produce PDF/A-1B
2017-10-11 14:32:58 -07:00
James R. Barlow
984df023b1
Fixup manifest
2017-10-11 13:12:14 -07:00
James R. Barlow
6f8682f558
Track .coveragerc for future reference
2017-10-11 13:05:19 -07:00
James R. Barlow
51defa6d66
Import cleanup and some pylint fixes
2017-10-11 12:58:35 -07:00
James R. Barlow
7d73098d6e
ghostscript.py: fix missing imports
2017-10-11 12:39:16 -07:00
James R. Barlow
c580aa4683
Revert to pre-build stages travis.yml
...
It's still in beta for a reason apparently
2017-10-11 11:32:47 -07:00
James R. Barlow
47d1199360
Fix travis.yml typo
2017-10-11 11:26:08 -07:00
James R. Barlow
61ab435b31
Try disabling the matrix and osx for build stages
2017-10-11 11:18:32 -07:00
James R. Barlow
aa8f534b45
pipeline: fix variable not defined in __init__
2017-10-11 11:17:33 -07:00
James R. Barlow
dc9589aca8
travis: Explicitly set python versions
2017-10-11 00:37:13 -07:00
James R. Barlow
dd6eaacc6b
More travis build tweaks
2017-10-11 00:28:33 -07:00
James R. Barlow
37dc03eec6
Add workaround for tess4 form feed behavior change
2017-10-10 23:33:54 -07:00
James R. Barlow
6b478172f6
Try using plain tessdata instead of tessdata_best
2017-10-10 20:52:03 -07:00
James R. Barlow
c6e73bcfd6
Still failing, did the cp work at all?
2017-10-10 15:15:26 -07:00
James R. Barlow
a2d62938ce
cp overwrite needs sudo
2017-10-10 14:54:52 -07:00
James R. Barlow
d7ae1f3cca
travis: Replacement problematic traineddate file
2017-10-10 14:39:05 -07:00
James R. Barlow
70219581c4
Disable tesseract 4 so tests can succeed
...
tess4 -psm 0 is broken right now
2017-10-10 14:18:02 -07:00
James R. Barlow
f70ac9fb89
Workaround travis issues in build stages... maybe
2017-10-10 12:36:50 -07:00
James R. Barlow
235b9fbaf0
Resolve merge conflicts
2017-10-10 12:24:10 -07:00
James R. Barlow
ebda7f42db
travis: need script for each stage
2017-10-10 12:22:23 -07:00
James R. Barlow
0b04e4b977
Try out travis build matrix
2017-10-10 12:14:50 -07:00
James R. Barlow
9498601a37
Add docs on adding to docker iamge
2017-10-10 12:13:20 -07:00
James R. Barlow
ef5d320e06
Ignore .vscode too
2017-10-09 16:19:41 -07:00
James R. Barlow
b00c9a562d
Remove meaningless version from Dockerfile.polyglot
2017-10-09 16:18:02 -07:00
James R. Barlow
5372656893
Don't say tess4 support is experimental - it's pretty good now
2017-10-09 16:17:42 -07:00
James R. Barlow
571de0e368
Update release notes
2017-10-08 12:41:03 -07:00
James R. Barlow
82cea2fd85
Update batch processing docs to include Synology script
2017-10-08 12:34:36 -07:00
James R. Barlow
aed9814345
Use Ubuntu 17.04 instead of 16.10 for Docker image (issue #191 )
...
Due to 16.10 PPAs no longer being generated by alex-p
2017-10-08 12:13:20 -07:00
James R. Barlow
34fc1f5fd7
Add reminder that blank.pdf is not trivial
2017-09-13 01:19:18 -07:00
James R. Barlow
87c2ed8b27
Improve clarity of --pdf-renderer=tesseract deprecation warning
2017-09-12 14:34:53 -07:00
James R. Barlow
1467d118ab
Add more leptonica functions
2017-09-06 00:27:02 -07:00
James R. Barlow
922dbe83c3
Update MANIFEST rules
2017-09-02 20:05:57 -07:00
James R. Barlow
6af7d61ee5
Fix CI failure due to spoofers not being updated to Tesseract 3.05 strings
2017-09-01 16:17:26 -07:00
James R. Barlow
bafd08391d
Update release notes
2017-09-01 12:50:45 -07:00
James R. Barlow
82ebd8ef1a
Fix missing error message about trying to use sandwich on old tesseract
2017-09-01 12:50:36 -07:00
James R. Barlow
4ed1aa4d23
Release notes: fix indentation
2017-09-01 12:47:22 -07:00
James R. Barlow
d04e43d46d
Update copyright info for test files
...
[ci skip]
2017-09-01 01:00:32 -07:00
James R. Barlow
952f0cca15
Dockerfiles: set LANG=C.UTF-8
...
Issue #184 to avoid issue with printing UTF-8 text to sidecar
2017-08-30 13:25:54 -07:00
James R. Barlow
f6a4d8f1f8
Fix Ubuntu 14.04 install instructions to account for dropping Py3.4 support
...
[ci skip]
2017-08-27 13:53:36 -07:00
James R. Barlow
b3097a2384
Fix broken test case related to language packs
2017-08-24 13:01:02 -07:00
James R. Barlow
6d9ddbe98b
v5.3.1 notes
2017-08-24 01:09:19 -07:00
James R. Barlow
9bb42c0229
Wrong error type used for missing language
2017-08-24 01:07:23 -07:00
James R. Barlow
bd7226b27a
Merge branch 'master' of github.com:jbarlow83/OCRmyPDF
2017-08-23 23:30:19 -07:00
James R. Barlow
5b413e3873
Cookbook: add "don't OCR" examples
2017-08-23 23:29:41 -07:00
James R. Barlow
be5831a629
Offer the readme as a long description for new PyPI
2017-08-23 23:29:21 -07:00
jbarlow83 and GitHub
084d2bf8e2
More badges
2017-08-23 23:19:29 -07:00
James R. Barlow
da79e6bac7
macos: Skip brew audit because it seems to crash ruby on travis
2017-07-27 16:00:41 -07:00
James R. Barlow
c4831ac00c
v5.3 release notes
2017-07-27 00:11:12 -07:00
James R. Barlow
93a954ef9f
Fix missing import for Py3.5
2017-07-26 23:40:01 -07:00
James R. Barlow
f7ce8f44e9
Weaken the --user-words test so it will pass on Travis
2017-07-26 21:03:51 -07:00
James R. Barlow
0b012697e5
Whitelist the Latin-1 languages that work with HOCR
...
Omitted French because the rare 'oe' and 'ÿ' glyphs are not in Latin-1.
Basically steer people away from HOCR renderer but avoid a potential
disruptive behavior change.
2017-07-26 21:03:18 -07:00
James R. Barlow
58e357c992
Report location of attempted output_file that fails to write
2017-07-22 17:49:56 -07:00
James R. Barlow
71fbad83ad
Fix py3.5 test
2017-07-21 17:01:06 -07:00
James R. Barlow
52483072dc
Add a differential test that checks tesseract uses supplied word list
2017-07-21 16:40:20 -07:00
James R. Barlow
7f0b8621f3
Tests: accept rich path objects without having to str() everything
2017-07-21 16:39:22 -07:00
James R. Barlow
cd8db60b06
Crash test all renderers, not just two
2017-07-21 14:10:02 -07:00
James R. Barlow
1aa34f5d2e
Make some interfaces accepting of both str-paths and Path objects
2017-07-21 13:28:30 -07:00
James R. Barlow
dfa1d88ce9
Fix missing user_words/user_patterns from textonly_pdf case
2017-07-20 17:14:04 -07:00
James R. Barlow
dd38519f07
Merge branch 'feature/user-words' into develop
...
# Conflicts:
# ocrmypdf/exec/tesseract.py
2017-07-20 16:25:20 -07:00
James R. Barlow
098f5d4f0b
docs: remove deprecated example of pdftotext
2017-07-20 16:20:17 -07:00
James R. Barlow
ffc685d536
docs: envvar markup
2017-07-20 16:19:57 -07:00
James R. Barlow
cd1a99a0de
Refactor int(os.path.basename(s)[0:6]) -> page_number(s)
2017-06-26 13:29:40 -07:00
James R. Barlow
48e3b267fc
Accept PDFs with whitespace ahead of %PDF marker
...
Noticed in @aagahi 's fork
2017-06-26 13:17:47 -07:00
James R. Barlow
3a7c3417bb
Don’t check tags and branch at the same time as Travis doesn’t get this
...
Travis is weird
2017-06-13 13:14:34 -07:00
James R. Barlow
d792ef7222
Give the ‘auto’ renderer setting more test covfefe
2017-06-13 13:13:58 -07:00
James R. Barlow
2c24f67deb
Rename “tess4” renderer to “sandwich” and make it default in Tess 3.05.01
...
Tesseract 3.05.01 backported the textonly_pdf=1 which allows the use
of this superior PDF renderer prior to 4.00 alpha. This means that
the tess4 name is no longer accurate, so call it a sandwich because of
its merge-preserve characteristic. Preserve the tess4 name. Fix the
documentation and tests to reflect this.
Make it the default, because it’s better. It does not have the issues
the “tesseract” renderer does prior to Tess 3.05.00 with rendering
PDFs that Ghostscript corrupts, and it produces better output without
re-rastering.
Deprecate some old stuff to avoid the test suite growing obscenely
large.
2017-06-13 13:09:12 -07:00
James R. Barlow
9e75e28d0c
Homebrew needs x11 to compile Pillow
2017-06-13 11:03:26 -07:00
James R. Barlow
3232643809
Support “textonly PDF” renderer in Tesseract 3.05.01
2017-06-13 10:18:08 -07:00
James R. Barlow
f7ee9e90ce
Document what is meant by the ocrmypdf “API”
2017-06-13 10:15:11 -07:00
James R. Barlow
47298be132
Remove Python <3.5 test
2017-06-13 10:14:28 -07:00
James R. Barlow
a88fa83515
Travis: fix deploy conditions for homebrew autobrew
2017-05-31 02:29:32 -07:00
James R. Barlow
12bfe20385
v5.1 release notes
2017-05-29 14:36:50 -07:00
James R. Barlow
3d2f6f0772
Fix tess4 test using old-style pageinfo API
2017-05-29 13:51:21 -07:00
James R. Barlow
1cb607f64b
Merge UserUnit
2017-05-29 13:22:55 -07:00
James R. Barlow
d3c54fbbde
For —rotate-pages, rasterize preview at half DPI instead of 200 DPI
...
Ensures that time is not wasted on previews at higher resolution than
the input as was sometimes the case
2017-05-29 13:01:18 -07:00
James R. Barlow
28341b755f
Refactor common test fixtures
2017-05-29 12:47:55 -07:00
James R. Barlow
4b5cd420e1
Add new test file
2017-05-29 12:16:08 -07:00
James R. Barlow
1d57bcc99e
Fix Ghostscript rasterizing of UserUnit pages and related sizing issues
2017-05-29 12:14:10 -07:00
James R. Barlow
facdd13879
Ghostscript: refactor image output resizing
2017-05-29 11:42:27 -07:00
James R. Barlow
6e891f91d3
ghostscript, qpdf: Restore API backward compatibility
2017-05-29 11:13:06 -07:00
James R. Barlow
9b50ede977
Partially solve ghostscript rasterize_pdf producing wrong file size
...
Kludge. Assumes JPEG for now. Messy.
2017-05-25 01:17:43 -07:00
James R. Barlow
82cf010333
Error out if trying to produce PDF/A >200” due to Ghostscript limitation
2017-05-25 00:07:29 -07:00
James R. Barlow
6ff6c8614f
—output-type=pdf now outputs /UserUnit PDFs at the correct size
...
This currently distorts the output size because Tesseract assumes it
knows the DPI better than we do.
Does not work for Ghostscript, because it emerges that Ghostscript
honors /UserUnit for rasterizing but not in pdfwrite (resolve/wontfix).
https://bugs.ghostscript.com/show_bug.cgi?id=690781
Ghostscript’s output would need to be patched in a PDF/A safe way for
this to work. Temporary route may be to block Ghostscript if
/UserUnit.
2017-05-24 23:26:07 -07:00
James R. Barlow
eb1cd38f6c
Add an open helper that is compatible with pathlib
2017-05-24 16:19:15 -07:00
James R. Barlow
148b632b4f
Prove multiprocessing works, although it is still racy in some places
2017-05-23 16:32:13 -07:00
James R. Barlow
591e213713
Add more dependencies for autobrew
2017-05-23 13:52:28 -07:00
James R. Barlow
75f2262659
Ensure JobContext stuff is actually tested for IPC consistency
2017-05-19 17:57:07 -07:00
James R. Barlow
d9005a1074
pdfinfo: replace most remaining dict-style access
2017-05-19 16:17:36 -07:00
James R. Barlow
3e73fa81bf
pageinfo: deprecation warning
2017-05-19 16:17:07 -07:00
James R. Barlow
ba6e290231
Restore old pageinfo.py to avoid breaking compatibility
2017-05-19 15:49:23 -07:00
James R. Barlow
08e47117a3
Rename pageinfo to pdfinfo
2017-05-19 15:48:23 -07:00
James R. Barlow
532ef38157
/UserUnit is a scalar, not an array
2017-05-19 14:19:50 -07:00
James R. Barlow
4c09875890
docs: upload unpaper Dropbox link, .rst typo blocking macOS install
...
[ci skip]
2017-05-19 12:18:09 -07:00
James R. Barlow
0e98139712
Upload to upload.pypi.org/legacy as recommend by PyPA
...
https://github.com/pypa/warehouse/issues/1996#issuecomment-302784126
2017-05-19 12:06:24 -07:00
James R. Barlow
4c04d802d7
Introduce /UserUnit checking
2017-05-19 12:01:19 -07:00
James R. Barlow
b3dc404571
Update unpaper.deb link ( fixes #171 )
...
*Shakes fist a Dropbox*
2017-05-19 11:28:45 -07:00
James R. Barlow
8694f8d2eb
Replace magic strings colorspace and encoding with Enums
2017-05-18 22:32:27 -07:00
James R. Barlow
263f9b79f4
pageinfo: debug stuff
2017-05-18 21:52:55 -07:00
James R. Barlow
56d2aae963
Refactor from ImageInfo index to attribute accessing
2017-05-18 18:39:14 -07:00
James R. Barlow
127706153d
Refactor dictionary based image info to ImageInfo
2017-05-18 18:26:31 -07:00
James R. Barlow
caee5b1428
Access PageInfo instance variables instead of dictionary
2017-05-18 17:12:04 -07:00
James R. Barlow
6c12e7e944
Refactor pageinfo dictionary to PageInfo()
2017-05-18 16:53:38 -07:00
James R. Barlow
cd04ae6949
Refactor PdfInfo(str(filename)) -> PdfInfo(filename)
2017-05-18 16:43:50 -07:00
James R. Barlow
6a0b68298f
Refactor pdf_get_all_pageinfo to PdfInfo
2017-05-18 16:31:18 -07:00
James R. Barlow
0a2f732267
docs: Fix restructured text typos
2017-05-16 23:27:10 -07:00
James R. Barlow
4bade99f27
docs: Remark that someone got bash on Windows working
2017-05-16 23:24:34 -07:00
James R. Barlow
0b048cd24e
Join the build badge club
2017-05-16 23:24:05 -07:00
James R. Barlow
c69ee63d82
Travis, true is a program, not a keyword
2017-05-15 15:12:14 -07:00
James R. Barlow
744fa104d7
v5.0.1 release notes (anticipating)
2017-05-14 23:59:09 -07:00
James R. Barlow
e24ff0fd64
Travis: don’t update the homebrew version because we pushed to testpypi
2017-05-14 23:55:40 -07:00
James R. Barlow
5de107d44c
tesseract_cache: update explanatory notes
2017-05-14 23:54:09 -07:00
James R. Barlow
131a5b741d
tesseract.py: update canned HOCR template to tess 3.05 output
...
Seems better to not claim the existence of several entities that don’t
exist as the older one does
2017-05-14 23:40:09 -07:00
James R. Barlow
65b89687a9
ghostscript: fix missing “import sys”, only applicable for an exception
2017-05-14 23:38:52 -07:00
James R. Barlow
048ae40e75
Update copyrights
2017-05-14 23:38:28 -07:00
James R. Barlow
234183ecd2
Fix: Tesseract 3.04 is sensitive to order of configuration commands
...
“txt hocr” is not acceptable and does not produce expected output .txt
while “hocr text” works fine, so switch the order everywhere.
Should fix #169
2017-05-14 23:27:46 -07:00
James R. Barlow
fb067dc97b
cookbook: more on improving OCR
2017-05-14 23:16:47 -07:00
James R. Barlow
a1fea0ce16
docs: link to OCRmyPDF-web
2017-05-14 23:16:30 -07:00
James R. Barlow
e1e9135e93
Test suite: tidy up imports
2017-05-14 23:15:29 -07:00
James R. Barlow
aff982036b
autobrew: fix brew audit error on double blank line
2017-05-14 23:15:02 -07:00
James R. Barlow
d087649eab
Remove “null deploy script” since “/usr/bin/true” is equivalent
2017-05-12 15:37:02 -07:00
James R. Barlow
7f3fa46a40
v5.0 release notes
2017-05-12 14:14:28 -07:00
James R. Barlow
b1f79e4d97
Disable other use redo_ocr
2017-05-12 13:24:30 -07:00
James R. Barlow
115d6df94f
Warn user when —image-dpi is supplied but ignored
2017-05-12 12:09:53 -07:00
James R. Barlow
559af9635f
—redo-ocr is not implemented, so disable
2017-05-12 12:08:16 -07:00
James R. Barlow
cb06359c0b
Turn on Tesseract 4 cache in test suite
...
Travis is too slow without it, and perhaps it’s overly paranoid to
never cache Tess4. Maybe nuke the cache occasionally to be safe…
2017-05-12 11:42:27 -07:00
James R. Barlow
5e26bb29d9
Update requirements files
2017-05-12 11:41:15 -07:00
James R. Barlow
b0e95842b8
Fix Travis CI errors while looking around for Tess4
2017-05-12 00:40:00 -07:00
James R. Barlow
08e678f21f
rst: Clean up indentation
2017-05-12 00:12:06 -07:00
James R. Barlow
c17817810f
Update documentation for 3.03 support removal
2017-05-12 00:08:22 -07:00
James R. Barlow
ff5c38b1f7
Tell Travis to download Tesseract 4.00 from a PPA for testing
2017-05-11 23:52:13 -07:00
James R. Barlow
64314c1b82
Insist on Python 3.5 wherever we check for it
2017-05-11 23:51:45 -07:00
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
d211722a2f
.gitignore the docs Makefile
2017-05-11 23:28:52 -07:00
James R. Barlow
56e6ed1249
Fix missing import; all tests passing!
2017-05-11 23:28:05 -07:00
James R. Barlow
21982cf1cb
baiona_gray remove alpha channel
2017-05-11 23:23:37 -07:00
James R. Barlow
edc01408da
Update the .png files, again, hopefully without corruption
2017-05-11 23:20:50 -07:00
James R. Barlow
aee33c87ed
Merge release notes
2017-05-11 23:11:12 -07:00
James R. Barlow
0dae1602c7
Fix missing import PIPE
2017-05-11 23:07:20 -07:00
James R. Barlow
d926f07ac1
Stop git from corrupting .pngs
...
Grrr.
2017-05-11 23:07:06 -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
37ebcadfa1
Implement —user-words, —user-patterns
2017-05-09 17:54:56 -07:00
James R. Barlow
74d98216f1
Update documentation for Ghostscript behavior
2017-05-09 17:43:39 -07:00
James R. Barlow
4bdebf573e
Tell Travis CI to use multiple cores
...
Let’s see if this helps the build go faster
2017-05-09 17:24:32 -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
63a4a761dd
Revert "v4.5.7 release notes"
...
The change introduced regressions, so find another way to fix.
This reverts commit d077c03686 .
[ci skip]
2017-05-08 14:38:04 -07:00
James R. Barlow
d077c03686
v4.5.7 release notes
2017-05-06 22:34:54 -07:00
James R. Barlow
c97ea1f2a9
Update high DPI test case to confirm the output image is not downsampled
2017-05-06 22:34:01 -07:00
James R. Barlow
fd27df2abb
Update documentation to warn that transparency is not tested
2017-05-06 22:33:24 -07:00
James R. Barlow
bf04f03c4c
Fix corrupt test file “typewriter.png”
...
This file is not currently used in any tests, but could be, so replace
corrupt version with a useful one.
2017-05-06 22:28:34 -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
1464b9087a
Try Travis again with null deploy for OSX
2017-05-01 17:37:59 -07:00
James R. Barlow
e8cc8fc879
Add travis null_deploy for osx
2017-05-01 17:24:43 -07:00
James R. Barlow
fae2119b1e
v4.5.6 release notes
2017-05-01 15:55:02 -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
5b1a7880a9
Switch to Travis triggering Docker build to skip race condition with PyPI
2017-04-28 17:18:01 -07:00
James R. Barlow
474b6b0500
v4.5.5 release notes
2017-04-28 15:27:41 -07:00
James R. Barlow
6c8c1d8173
Fix #154 : KeyError ‘/Contents’ on blank pages with /Contents record
2017-04-28 15:22:05 -07:00
James R. Barlow
6a91fa637f
Squash merge improvements to auto-homebrewing macOS version
2017-04-28 15:17:38 -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
a1033cdc64
osx_brew: show output before letting “brew audit” check it
2017-04-18 23:38:07 -07:00
James R. Barlow
204336e1a5
Move release notes into the rest of documentation
2017-04-18 18:26:31 -07:00
James R. Barlow
8954e6c3b9
v4.5.4 Update release notes
2017-04-18 18:09:15 -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
James R. Barlow
2b82c31b85
Update documentation
2017-04-18 18:07:19 -07:00
James R. Barlow
9a4813089c
autobrew: remove homebrew dependency “zlib”, causes audit failure
2017-04-18 15:28:30 -07:00
James R. Barlow
554fcc8b9d
Add test case for #152
2017-04-18 15:20:25 -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
58d1042147
v4.5.3 release notes update
2017-03-29 23:50:31 -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
6e907856f2
Refresh requirements
2017-03-29 18:15:29 -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
4ad129d8d8
docs: Don't recommend system-site-packages anymore (Ubuntu 16.04)
...
Not needed since reportlab 3.4 comes with a wheel, and that was the main difficulty.
2017-03-23 08:13:28 -07:00
James R. Barlow
dfb9fa0736
autobrew: missing deps
2017-03-16 00:18:07 -07:00
James R. Barlow
eb036898e9
Update documentation with macOS homebrew tap
...
[ci skip]
2017-03-13 22:25:25 -07:00
James R. Barlow
7c6aa76a2a
Fix brew audit failure
2017-03-13 17:58:31 -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
35162166c5
Fix UnboundLocalError in autobrew.py
2017-03-13 15:51:39 -07:00
James R. Barlow
107f6abcb1
Fix autobrew build issues - missing deps
2017-03-12 17:07:38 -07:00
James R. Barlow
760a939e7d
Further autobrew tweaks
2017-03-11 17:05:26 -08:00
James R. Barlow
72660d0dec
MacOS skip the one test that needs poppler, to save installing poppler
2017-03-11 17:03:26 -08:00
James R. Barlow
8444a8f211
before_deploy doesn’t run unless something is going to be deployed
2017-03-11 17:03:20 -08:00
James R. Barlow
4a1fec8328
Improvements to macOS test and work on homebrew tap autobrew
...
Squashed commits:
[3f06c1e] Try setting up homebrew tap autobuilding
[01532f1] Strict mode error in brew
2017-03-11 17:00:54 -08:00
James R. Barlow
42547f6017
Revert "Finalize Dockerfile move; unfortunately not supported by Docker Hub"
...
Unfortunately because of this issue
https://github.com/docker/hub-feedback/issues/292
Docker Hub effectively automatically changes directory to the location
of Dockerfile, meaning needed files are not in the right places, so
this has to be reverted.
This reverts commit 65c9a07dde .
[ci skip]
2017-03-10 22:49:08 -08:00
James R. Barlow
0ccf564f03
Revert "Move Dockerfiles out of root"
...
This reverts commit 3d3b3abc1b .
2017-03-10 22:46:03 -08:00
James R. Barlow
65c9a07dde
Finalize Dockerfile move; unfortunately not supported by Docker Hub
...
Unfortunately because of this issue
https://github.com/docker/hub-feedback/issues/292
Docker Hub effectively automatically changes directory to the location
of Dockerfile, meaning needed files are not in the right places, so
this has to be reverted.
2017-03-10 22:45:31 -08:00
James R. Barlow
4700a19322
Move pipeline.svg out of root
2017-03-10 17:18:38 -08:00
James R. Barlow
3d3b3abc1b
Move Dockerfiles out of root
2017-03-10 17:17:36 -08: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
7b94129d9e
v4.5 notes
2017-02-14 13:03:48 -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
ab0a210763
Update dockerfile.tess4 yet again
...
Installing Tess4 PPA over Tess3 proved too much pain, so sever the link
between this and the jbarlow83/ocrmypdf image, starting each from
scratch. Also the complete set of language packs proves too much - the
build seems likely to fail when trying to install so many.
2017-02-14 11:32:05 -08:00
James R. Barlow
9f800736bc
Fix running_in_docker() check failing on newer Docker
...
This test has to work to ensure spoof/tesseract_cache.py has a writable
directory to put cache into. Otherwise those tests fail.
2017-02-13 02:16:06 -08:00
James R. Barlow
c9a83afad6
Improve batch processing examples
2017-02-13 02:14:32 -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
167470b4bd
Re-fix Dockerfile.tess4
...
[ci skip]
2017-02-10 15:43:49 -08:00
James R. Barlow
f06d3c2ec2
Fix tesseract 3.04 on tesseract 4 on image
...
[skip ci]
2017-02-10 08:38:22 -08:00
James R. Barlow
74c99a8a77
v4.4.2 release notes
2017-02-06 21:56:55 -08:00
James R. Barlow
0e4d312ee2
Adjust Travis deploy to PyPI settings
...
-only on master branch
-only Python 3.6 build uploads, so the others don’t compete
-don’t upload docs to PyPI
2017-02-06 21:27:59 -08:00
James R. Barlow
589f19559d
Rewrite Dockerfiles to use ubuntu 16.10 base system
...
Debian now has a few disadvantages:
-there is no convenient PPA for Debian tesseract 4.0, but there is for
Ubuntu
-Ubuntu sets locale to UTF-8 automatically removing the need to do this
All three ocrmypdf docker images are now based on a common Ubuntu
16.10 image, derived from the one used to build ocrmypdf-tess4.
-polyglot now differs from -tess4 only by opting into the tess4 PPA.
Both Ubuntu 16.10 and Debian stretch use tesseract 3.04.01 now making
the sharp.ttf patch unnecessary. /etc/apt/sources has been unused for a
while now both have newer Ghostscripts.
2017-02-06 14:39:29 -08:00
James R. Barlow
f28bc25dc0
Configure travis to handle deployment to PyPI; also lint .travis.yml
2017-02-06 13:50:53 -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
5b8d88af4c
Suggest use of aliases to hide docker run
2017-01-30 15:08:02 -08:00
James R. Barlow
fa82b50340
Adding missing file Dockerfile.tess4
2017-01-29 18:34:01 -08:00
James R. Barlow
005216bc57
Support ocrmypdf-tess4
2017-01-29 18:26:52 -08:00
James R. Barlow
e748fdcf6f
v4.4.1 release notes
2017-01-28 22:23:35 -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
ea0dd99d0b
More documentation updates
2017-01-28 15:35:59 -08:00
James R. Barlow
e0cc67afae
docs: suggest —oem 1
2017-01-28 14:58:25 -08:00
James R. Barlow
04f9cbe364
Describe how to use tesseract 4.0 while 3.04 is installed
2017-01-27 18:13:59 -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
a6feacc810
travis: fix ‘pip install’ by moving working code out of the way
2017-01-27 14:33:23 -08:00
James R. Barlow
65e4b1672f
cffi: verbose=True
2017-01-27 14:17:13 -08:00
James R. Barlow
46cc0dd190
Revert "Do we need to exclude ocrmypdf.lib?"
...
This reverts commit 678b9fb603 .
2017-01-27 13:51:30 -08:00
James R. Barlow
678b9fb603
Do we need to exclude ocrmypdf.lib?
2017-01-27 13:49:11 -08:00
James R. Barlow
49ab0c1f0b
setup.py: cffi is definitely needed in setup_requires
2017-01-27 13:43:47 -08:00
James R. Barlow
ab490a7736
Experiment: update *requirements.txt, use more current travis build steps
...
Perhaps this works around the pip/setup.py asymmetry that broke the
4.4 release.
2017-01-27 13:13:14 -08:00
James R. Barlow
e4ce1dae35
setup.py: for some reason, subpackages must be explicitly specified
2017-01-27 00:37:05 -08:00
James R. Barlow
179b812acb
Fix readthedocs build error
2017-01-26 23:57:51 -08:00
jbarlow83 and GitHub
7f170517ec
Note about pytest-helpers-namespace
2017-01-26 23:15:32 -08:00
James R. Barlow
5480da4f04
Additional docs updates for v4.4
2017-01-26 23:02:44 -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
55aeaec293
Autorotation check: Replace duplicated tests with parameterized test
2017-01-26 18:07:59 -08:00
James R. Barlow
f6df1fb40c
Fix test suite regression: output files dumped in tests/resources
2017-01-26 18:07:09 -08:00
James R. Barlow
b889a89c36
Fix remaining 3.4/3.5 regressions
2017-01-26 17:53:27 -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
e864c65d26
(Hopefully) Fix Path <-> py.path conversion on Py3.4/3.5
2017-01-26 17:19:15 -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
fb9e7c82f6
Move duplicate test code into common namespace
2017-01-26 13:36:52 -08:00
James R. Barlow
77d31bf646
Add renderers page (missed from previous)
2017-01-26 13:20:44 -08:00
James R. Barlow
29ca799bcf
Move pytest.ini into setup.cfg
2017-01-26 12:45:38 -08:00
James R. Barlow
467b7f0163
Update docs for eventual v4.4 release
2017-01-26 12:29:11 -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
James R. Barlow
ac40426971
Implement “tesstop” (tesseract v4 text-only pages - working name)
2017-01-20 17:16:01 -08:00
James R. Barlow
7acfaf6d34
pipeline: rename some of the stages, for clarity
2017-01-20 17:15:00 -08:00
James R. Barlow
99e47c9c04
tesseract: add support for using v4 textonly_pdf feature
2017-01-20 17:06:23 -08:00
James R. Barlow
d7904e2251
Travis now has Python 3.6, test against it
2017-01-20 14:26:17 -08:00
James R. Barlow
68aef489de
Merge branch 'master' (4.3.5, Python 3.6 support) into develop
...
# Conflicts:
# dev_requirements.txt
# requirements.txt
2017-01-20 14:25:28 -08:00
James R. Barlow
3f9adcd5e0
Document idea for producing companion text files
2017-01-19 16:48:05 -08:00
James R. Barlow
6cc5135d2d
Output to stdout: ensure stdout is flushed to prevent truncation errors
2017-01-19 16:41:10 -08:00
James R. Barlow
d4c72b371f
Forward --oem argument to tesseract 4
2017-01-18 21:37:50 -08:00
James R. Barlow
18b6f05657
Resolve issue #124 - poor performance with Tesseract v4
...
It seems that Tesseract v4 on a platform with OpenMP working correctly
while perform poorly with ocrmypdf because each will also soak up all
available CPUs. Running N^2 processes/threads on a N-core CPU where
each wants 100% of CPU turns out to be detrimental.
So, we restrict ocrmypdf w/tessv4 to a single Tesseract process at a
time, for now. Alternative may be to limit OpenMP threads if throughput
is higher.
2017-01-18 17:52:12 -08:00
James R. Barlow
c42d9baa26
tesseract: for v4, use --psm while keeping -psm for v3
...
At the moment v4 accepts both but who knows if this will get dropped,
so do as document for each version.
2017-01-18 17:43:47 -08:00
James R. Barlow
6e27ecd2b9
Finalize ‘exec’ migration and make it backward compatibility for now
2017-01-18 17:40:50 -08:00
James R. Barlow
482692396e
Add installation instructions for Ubuntu 16.04
2017-01-17 08:17:56 -08:00
James R. Barlow
c48acf165a
v4.3.5: Python 3.6 compatibility
2017-01-03 00:45:33 -08:00
James R. Barlow
9e004c3ec0
Another attempt at py 3.4/3.5
...
Revert to exactly what the previous passing build specified.
2017-01-03 00:34:26 -08:00
James R. Barlow
7be4e9c919
fix setuptools-scm for py 3.4, 3.5
2017-01-03 00:25:57 -08:00
James R. Barlow
5ec38a4bed
Update requirements files and documentation for Python 3.6 - no code changes
2017-01-03 00:11:34 -08:00
James R. Barlow
f246779b8e
pdfa: documentation, remove from __future__
2016-12-12 15:10:10 -08:00
James R. Barlow
a7d8cdf061
Don’t copy pageinfo - job manager already provides a copy of real pdfinfo
2016-12-12 15:09:41 -08:00
James R. Barlow
620745c812
pipeline: don’t use qpdf to check page count again
...
We already know the number of pages at this stage.
2016-12-12 15:09:11 -08:00
James R. Barlow
b8767e5ba9
Rename exe -> exec, more Unix-y and suggestive
2016-12-10 15:34:00 -08:00
James R. Barlow
d33a50660d
Replace most sys.exit() with raising exceptions
...
Because ruffus doesn’t handle exceptions well I tended to call sys.exit
to make sure we got out of dodge when needed. However, sys.exit is not
ideal for the Python API this is moving towards, so this introduces
proper exceptions for the various cases that retain suggested error
codes. Only __main__.py should call sys.exit now, everyone else has to
throw an exception.
For now the worker raising a fatal exception is logging messages rather
than passing an exception object with the fatal error message, mainly
because ruffus doesn’t properly marshall the exception object so we
just check “what is the name of the exception class that caused ruffus
to thrown an RethrownJobError”?
Also fixed along the way was the wrong return code being shown for
encrypted PDF checking, and incorrect use of str.find (e.output.find)
in boolean logic (str.find returns -1 on failure to find, which is True).
2016-12-10 15:24:24 -08:00
James R. Barlow
4ee9658e97
Move external program wrappers to ocrmypdf.exe package
2016-12-09 16:54:24 -08:00
James R. Barlow
dd1b84e7ba
More refactoring - helpers.py
2016-12-09 16:31:08 -08:00
James R. Barlow
4c677e6c47
Extract pipeline out of __main__.py and into pipeline.py
...
This leaves __main__.py to handle command line arguments while pipeline.py
runs the pipeline - mostly. They are still somewhat intertwined, with
__main__.py doing essential things for pipeline.py, etc., and some
helper functions that could go in their own module.
All tests pass after this major refactor.
2016-12-09 16:17:12 -08:00
James R. Barlow
f0f889440b
Merge branch 'master' into feature/ooruffus
2016-12-08 16:36:03 -08:00
James R. Barlow
cc9ceaeb74
v4.3.4: release notes
2016-12-08 16:34:09 -08:00
James R. Barlow
ad2fa8d1d7
Fix MANIFEST for .png
2016-12-08 16:25:04 -08:00
James R. Barlow
adc1580742
Help py.test collect output in more cases
2016-12-08 16:21:07 -08:00
James R. Barlow
4d3b44d6df
ghostscript: cleanup harmless error message printed for overprint
...
Redirect stderr->stdout to hopefully make GS output easier to work with
overall, since the previous code didn’t seem to account for mixed used
properly.
2016-12-08 16:19:15 -08:00
James R. Barlow
e57aa0eee2
pageinfo: fix “decimal.InvalidOperation: quantize result has too many digits”
...
And add new test case for this.
2016-12-08 16:06:53 -08:00
James R. Barlow
1ae1d116c7
Make setup.py license internally consistent
2016-12-08 16:06:31 -08:00
James R. Barlow
097a69d07f
pageinfo: fix “decimal.InvalidOperation: quantize result has too many digits”
...
And add new test case for this.
2016-12-08 16:04:14 -08:00
James R. Barlow
a81ce87a50
Remove non-reentrant options checking and logging setup
2016-12-05 14:13:36 -08:00
James R. Barlow
88be0d43a0
Make setup.py license internally consistent
2016-12-03 21:37:24 -08:00
James R. Barlow
ff16a00a3d
Remove test for Pillow JPEG and PNG
...
As of 3.1.1, our minimum version, these codecs are now required by
default for a successful installation, effectively solving the problem
of Pillow installed without libjpeg/libpng.
2016-12-03 14:25:46 -08:00
James R. Barlow
8982b3e1e2
Update requirements
...
-update requirements.txt and dev_requirements.txt to more recent version
-setup.py updated to Ubuntu 14.04 rather than 12.04 backports
-request at least Pillow 3.1.1 now (since this makes jpeg/png mandatory)
2016-12-03 14:14:07 -08:00
James R. Barlow
be0fa35d14
Merge branch 'master' into feature/ooruffus
2016-12-03 14:02:43 -08:00
James R. Barlow
9f51ed9d01
Finalize v4.3.3 release notes
2016-12-03 00:39:24 -08:00
James R. Barlow
731e6792c7
Add test cases for Ghostscript PDF/A warnings
2016-12-03 00:32:09 -08:00
James R. Barlow
c35ec0b4aa
ghostscript: more effort at error logging
2016-12-03 00:22:03 -08:00
James R. Barlow
03aaf575dc
v4.3.3 release notes, fix more gs 9.20 issues
2016-12-02 16:26:34 -08:00
James R. Barlow
9a060579ba
Move work_folder into multiprocessing manager
2016-12-02 01:39:17 -08:00
James R. Barlow
d40a5c4f7a
Remove all remaining traces of ‘options’ global state from task runners
2016-12-02 01:31:57 -08:00
James R. Barlow
21f7dc3377
Distribute ‘options’ to worker processes via the multiprocessing manager
2016-12-02 01:06:11 -08:00
James R. Barlow
43c13a1ed9
Replace pdfinfo, pdfinfo_lock with multiprocessing manager
...
Using a context manager to guard the pdfinfo list makes the lock
unnecessary. (Although it was probably unnecessary in the first place
anyway.)
2016-12-01 23:36:30 -08:00
James R. Barlow
6bc3f189e1
Remove “WrappedLogger” - does not do anything useful
...
Never really investigated the reason why ruffus returns a mutex to go
along with its logger. It seems that the mutex is only needed if one
wanted to make multiple successive calls to a log function and have
them appear appear atomically. It is not needed to protect the logger
proxy because accessing the proxy triggers IPC in the child process
that handles the multiprocessing.Manager() object.
The logging wrapper only logs one line at a time, so the mutex does not
actually protect logging sequence. Cut it.
Also manager.Lock() returns a threading.Lock object so the purpose of it
is actually to help processes share a thread-level lock. It would be
more appropriate to use a semaphore based multiprocessing.Lock.
2016-12-01 15:27:07 -08:00
James R. Barlow
2c5437135c
Remove temporary re_symlink logging shim
2016-12-01 00:31:42 -08:00
James R. Barlow
444da02523
Fix mistake made in converting pipeline; incredibly, all tests pass now
2016-12-01 00:30:19 -08:00
James R. Barlow
00e8af2381
Reactivate the pipeline; surprisingly works in quick test
2016-12-01 00:03:03 -08:00
James R. Barlow
401b21864f
Convert to object oriented ruffus syntax (does not run)
...
I experimented with the idea of using asyncio-based processing but
realized that that does not solve the import time binding problem
that is the real issue. Therefore the simpler refactoring is to convert
to ruffus-oo syntax and get things working again.
build_pipeline() is really ugly at the moment. The old syntax had its
advantages.
This test reproduces the complete pipeline graph but does not work
otherwise.
2016-11-30 23:58:26 -08:00
James R. Barlow
de939951d4
Record version in debug log
2016-11-29 15:30:50 -08:00
James R. Barlow
7725d16a26
Fix exception on inline stencil masks with no /CS attribute
2016-11-24 22:37:00 -08:00
James R. Barlow
8a74408d83
Add security suggestions
2016-11-21 20:58:31 -08:00
James R. Barlow
3d0dc95a06
Moved venvs
2016-11-21 20:40:22 -08:00
James R. Barlow
04a57a3cc2
OS X -> macOS
2016-11-21 20:40:06 -08:00
James R. Barlow
d0c22ce01d
v4.3.2 release notes
2016-11-10 23:16:08 -08:00
James R. Barlow
23c95e9660
ghostscript: elide overprinting to fix PDF/A errors in GS 9.20
...
It looks like GS 9.19 can incorrectly set overprinting for the text layer
even though this makes no sense in PDF/A, or at least someone produced
PDFs that have this after a Tesseract PDF -> GS PDF/A conversion. GS 9.20
complains about this. Instead of aborting, elide the feature.
See
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=094d5a1880f1cb9ed320ca9353eb69436e09b594
and
issue #107 .
It looks like it is better to elide features and warn about elision rather
than abort with an error.
2016-11-10 14:48:02 -08:00
James R. Barlow
eecab9b95d
pdfa: fix KeyError on pdfa_dict if document has some xmp metadata but
...
not exactly what we’re looking for
2016-11-09 05:41:12 -08:00
James R. Barlow
8abc2f113c
Merge branch 'develop'
2016-11-07 14:36:50 -08:00
James R. Barlow
949d2ff1c2
v4.3.1 release notes
2016-11-07 14:36:08 -08:00
James R. Barlow
1c8b763d53
test_pageinfo: Remove bits per component test
...
The behavior of this test will ultimately depend on what version of
img2pdf is installed, since after my patch it will be able to produce
1bpp images.
2016-11-07 14:35:54 -08:00
James R. Barlow
bb91393b85
Fix “deskew-rotate” bug.
...
Turns out this occurred in any case where pdf-renderer hocr was used
and a tesseract timeout or error occurred. We created a replacement
page based on the unrotated page dimensions instead of the input image’s
dimensions.
2016-11-07 14:17:31 -08:00
James R. Barlow
cc9c0d819e
Add test case for documents that get rotated incorrectly after deskew
2016-11-07 14:15:03 -08:00
James R. Barlow
a72b8caf47
Update documentation on other languages, multilingual documents
2016-11-07 14:14:06 -08:00
James R. Barlow
fdd9b8b8ce
Optimize some of the test resources to reduce file sizes
...
Mostly by reducing RGB -> monochrome and applying JBIG2 compression
2016-11-07 14:01:23 -08:00
James R. Barlow
c096b4ca8c
Make debug dump of pageinfo at the end of processing readable
2016-11-04 02:23:02 -07:00
James R. Barlow
427add3008
Add @posttask debug hooks
2016-11-03 18:15:21 -07:00
James R. Barlow
c45871700d
Fix bug: LeptonicaErrorTrap() leaks file handles
2016-11-03 15:51:27 -07:00
Sean Whitton and jbarlow83
6821e8eeb2
disable mathjax sphinx extension ( #103 )
...
Mathjax isn't actually needed for OCRmyPDF's docs, but enabling this
extension causes the browser to download a copy of mathjax.js from
cdn.mathjax.org anyway.
I have to disable this for the offline docs bundled with Debian, but
since you're not using mathjax, it would be nice to have the diff merged
upstream.
2016-11-01 21:56:57 -07:00
James R. Barlow
a4f07756a5
tesseract caching: don't transcode tesseract's output, hash source file
...
For sanity's sake, deal with tesseract streams in binary without
transcoding (via universal_newlines, etc.). The only differences are
printing messages regarding spoofing.
Also hash the source file so that changes to the cache mechanism
invalidate old cache automatically. That is probably too aggressive,
but simple and safer than the previous approach.
2016-10-28 16:44:12 -07:00
James R. Barlow
f24fb0e0c5
Obligatory MANIFEST.in repair
2016-10-28 01:28:46 -07:00
James R. Barlow
73b88a0a6f
More work on documentation
2016-10-28 01:22:40 -07:00
James R. Barlow
c42f39e2d4
Update README to point to ReadTheDocs
2016-10-28 00:33:17 -07:00
James R. Barlow
5e5fe3175f
docs: OS X -> macOS branding change
2016-10-28 00:32:57 -07:00
James R. Barlow
cab65d1f11
pageinfo: add a python3.4 implementation of isclose()
2016-10-28 00:31:04 -07:00
James R. Barlow
245f05d5f4
docs: allow python setup.py install --force to bypass checks
...
ReadTheDocs needs this.
2016-10-28 00:07:26 -07:00
James R. Barlow
dda751f9e3
Merge branch 'feature/docs' into develop
...
# Conflicts:
# ocrmypdf/__main__.py
2016-10-27 23:50:08 -07:00
James R. Barlow
3d37ae988a
Update release notes for 4.3
2016-10-27 23:48:12 -07:00
James R. Barlow
717acd9855
Prevent dumping binary PDFs to stdout
2016-10-27 16:20:53 -07:00
James R. Barlow
2e4431cc63
Allow piping output to stdout
2016-10-27 16:14:42 -07:00
James R. Barlow
f7387b0859
test_stdin: simplify this test
...
No need to involve 'cat', just hook the file up to stdin.
2016-10-27 16:01:07 -07:00
James R. Barlow
a09f6b8977
Test cases: check that stdout is clear of output
...
To ensure piping to stdout is possible.
2016-10-27 15:58:24 -07:00
James R. Barlow
d63449c214
main: don't print output file location to stdout, use stderr
2016-10-27 15:57:33 -07:00
James R. Barlow
a86805f0d9
Remove possibly non-free page from "multipage.pdf"
2016-10-27 15:56:43 -07:00
James R. Barlow
7d2009ccef
ghostscript: log errors from stdout
2016-10-27 15:36:20 -07:00
James R. Barlow
18ae5db06d
ghostscript: ensure raster resolution is specified in integer units
2016-10-27 15:35:33 -07:00
James R. Barlow
9a1838f102
pageinfo: accept "cm/Do" image drawing without the usual "q/Q" wrapper
...
Some PDFs omit the traditional q/Q wrapper and alter ctm with a stack
depth of zero, so make our test for stack depth specifically test for
the case where the PDF calls for rendering to an uninitialized ctm.
Probably related to #97 .
2016-10-27 15:35:00 -07:00
James R. Barlow
e20346032d
leptonica: add color testing functions for future experiments
2016-10-27 14:49:49 -07:00
James R. Barlow
693a27d76c
leptonica: add iPython display hook and equality test
2016-10-26 14:44:41 -07:00
James R. Barlow
203966d86b
leptonica: fix Pillow conversion for 1-bit and 8-bit gray images
2016-10-26 13:10:13 -07:00
James R. Barlow
7eca8508fd
Implement new preprocessing feature, background removal
2016-10-14 17:23:34 -07:00
James R. Barlow
b85270df1c
Merge branch 'master' into develop
2016-10-14 15:56:58 -07:00
James R. Barlow
aff597cef4
v4.2.5: update release notes, fix silly typo in pageinfo.py
2016-10-13 13:26:39 -07:00
James R. Barlow
61b05b3dee
Fix issue: BitsPerComponent is an optional field, sometimes omitted
2016-10-13 13:15:27 -07:00
Julian Kahnert and jbarlow83
453c4ef602
Update README.rst ( #98 )
...
`brew install tesseract` just installed the english language pack not French, German or Spanish
2016-10-12 11:20:58 -07:00
James R. Barlow
cf4b04f92d
The main 'quick' test should be a file that OCRs to recognizable text
2016-10-07 16:25:34 -07:00
James R. Barlow
06c6999987
Merge commit '07891d994aab92e7a14aebe1ac509aab2d4f170c'
2016-10-07 12:45:56 -07:00
James R. Barlow
013c5a369f
Replace redacted file with an OCR-able file
2016-10-07 12:45:22 -07:00
James R. Barlow
07891d994a
Replace redacted file with an OCR-able file
2016-10-07 12:44:49 -07:00
James R. Barlow
6baf8668a6
Replace with non-free file milk.pdf with free equivalent
2016-10-06 13:10:28 -07:00
James R. Barlow
4ba2962c56
Comment on non-free files
2016-10-05 16:48:16 -07:00
James R. Barlow
7ad92f5db4
Merge branch 'master' of https://github.com/jbarlow83/OCRmyPDF
2016-10-05 16:39:00 -07:00
James R. Barlow
4dad09cc91
resources/README: replace the other large table with a list table
2016-10-05 16:38:51 -07:00
Sean Whitton and jbarlow83
7b2e0c7a7a
also exclude .git in pytest.ini ( #94 )
2016-09-15 08:56:14 -07:00
Sean Whitton and jbarlow83
7f08f15fc9
pytest skipif for milk.pdf test ( #95 )
...
Skip the test if the fair use restricted milk.pdf is not present.
2016-09-15 08:55:31 -07:00
James R. Barlow
825c0f8b2a
Note that milk.pdf is non-free, start using list-tables
2016-09-10 14:44:00 -07:00
James R. Barlow
dbe880bc41
Update tesseract supported languages
2016-09-09 12:55:07 -07:00
James R. Barlow
2ec516b6ff
leptonica: learn a few new tricks
...
Found some interesting options for background norm.
2016-09-09 12:54:36 -07:00
James R. Barlow
7942a01e50
leptonica: This is not a Py2 module anymore
2016-09-08 20:59:38 -07:00
James R. Barlow
df684f9344
Update tesseract supported languages
2016-09-08 15:52:25 -07:00
James R. Barlow
ae16e95e42
leptonica: scale should be a tuple for consistency
2016-09-08 11:38:10 -07:00
James R. Barlow
2ac8e8a0cc
More doc tweaks, mainly introduction
2016-09-08 11:29:53 -07:00
James R. Barlow
0a0ceda71f
Start the documentation
2016-09-06 13:52:40 -07:00
James R. Barlow
220f1ce161
tasks.py: stop tracking this file for now
...
This helper script is still in development and needs to be changed each
release, which breaks the release.
It shouldn't be in MANIFEST.in at all because it's not part of a
distribution.
2016-09-04 10:55:57 -07:00
James R. Barlow
c62a8a97c9
v4.2.4 release notes
2016-09-01 21:33:38 -07:00
James R. Barlow
f8a1136979
tasks: show logging info
2016-09-01 21:24:13 -07:00
James R. Barlow
9ca29c787b
Update description of masks.pdf to reflect what it actually tests
2016-09-01 21:21:14 -07:00
James R. Barlow
6af748a251
pageinfo: regression - didn't add inline images to list
2016-09-01 15:27:51 -07:00
James R. Barlow
9041867f86
pageinfo: exclude images from DPI calculation if drawn at stack depth 0
...
More thorough testing showed that Acrobat do not presume that images
fill the page if the CTM is unspecified, as tests/resources/masks.pdf
seems to want. Instead they treat it literally and draw the image
as 1x1 PDF units or 1/72" square in the bottom left corner of the page.
Seems like the best thing to do is ignore any such images for the purpose
of DPI calculation. masks.pdf still works out okay because it has
other images.
For more robustness we could consider invalidating any DPI above some
limit, or warning the user about these microdot thumbnails.
2016-09-01 14:23:31 -07:00
James R. Barlow
04099b087c
pageinfo: handle stencil masks when stack depth > 0
2016-09-01 14:03:30 -07:00
James R. Barlow
6d6234714c
tasks: fix logic error and make magic numbers disappear
2016-09-01 14:03:08 -07:00
James R. Barlow
520be23481
Add release helper script
2016-08-31 20:33:04 -07:00
James R. Barlow
346c3c8dd3
Start tracking development requirements
2016-08-31 20:31:31 -07:00
James R. Barlow
bd534c3313
main.py -> __main__.py
...
Executing a package with python -m packagename will check for
__main__.py inside the package. In other words main.py should have
always been named __main__.py.
In the unlikely event that someone depends on "import ocrmypdf.main"
being meaningful, main.py continues to exist and replicates the
behavior of __main__. (It's unlikely because import ocrmypdf.main does
unpythonic ruffus-related things at things import time, essentially
configuring itself to work with sys.argv. To fix another day.)
This should solve the problem of Debian needing to run test suites
before installation and afterwards for continuous integration without
having to patch either file, as python -m ocrmypdf will follow import
order. That is, if the current directory contains "ocrmypdf/" (e.g.
staging a new version) then that will be tested, else sys.path will
be checked.
2016-08-31 17:01:42 -07:00
James R. Barlow
2625368aed
link: more MANIFEST.in tweaks
2016-08-31 16:28:39 -07:00
James R. Barlow
8ac94879f1
lint: no need to check for DEVNULL; all supported versions have it
2016-08-31 16:28:18 -07:00
James R. Barlow
dd8c0f3756
Merge branch 'master' of https://github.com/jbarlow83/OCRmyPDF
2016-08-31 13:19:46 -07:00
James R. Barlow
010f353a5e
v4.2.3 release notes
2016-08-31 13:19:27 -07:00
James R. Barlow
e0a18edb92
Fix MANIFEST.in, as Python packages require
2016-08-31 13:19:17 -07:00
James R. Barlow
c6f2eea058
Reinstate OCRmyPDF.sh with a deprecation warning
2016-08-31 11:57:02 -07:00
James R. Barlow
bf89e38c69
Add milk.pdf test case
2016-08-31 11:42:21 -07:00
jbarlow83 and GitHub
e1f0640d42
Create issue template
2016-08-31 11:26:29 -07:00
James R. Barlow
71b54035ba
Bug fix issue #89 : trying to perform arithmetic on IndirectObject
...
TypeError: bad operand type for unary -: 'IndirectObject'
2016-08-31 10:25:58 -07:00
James R. Barlow
325cc0beca
Allow test cases to run without installing first
...
As @spwhitton found:
The test suite needs to call "python3 -m ocrmypdf.main" instead of
just "ocrmypdf" because this /usr/bin/ocrmypdf script has not yet been
generated when dh runs the test suite.
---
Seems reasonable to perform in-place testing independent of installation.
Source:
https://sources.debian.net/src/ocrmypdf/4.2.1%2Bgit.20160824.1.5d67cc7-1/debian/patches/0001-patch-test-suite-executable.patch/
2016-08-26 15:23:26 -07:00
James R. Barlow
1a9f09c4d5
Remove OCRmyPDF.sh and its usage in all test cases
2016-08-26 15:18:38 -07:00
James R. Barlow
4fed4e2af3
tests: don't try to pass Unicode arguments on command line on Linux
...
Depends on locale being configured properly, and it's not necessary
to be able to do this.
2016-08-26 15:08:56 -07:00
James R. Barlow
74cc2346a5
pytest.ini: apply patch from Debian to exclude .pc dir
...
https://sources.debian.net/src/ocrmypdf/4.2.1%2Bgit.20160824.1.5d67cc7-1/debian/patches/0003-pytest-exclude-.pc-dir.patch/
From: Sean Whitton <spwhitton@spwhitton.name >
Date: Thu, 12 May 2016 08:21:39 -0700
Subject: pytest exclude .pc dir
Forwarded: not-needed
Patches to the test suite present in .pc confuse pytest.
2016-08-26 15:07:11 -07:00
James R. Barlow
cc7e328358
Improve some documentation for tests
2016-08-26 15:04:08 -07:00
James R. Barlow
d25397e2b0
Add test case for PDFs with masks and stencil masks
2016-08-26 15:03:27 -07:00
James R. Barlow
bc11454e1c
Help text: example of shell pipeline with img2pdf
2016-08-25 14:58:25 -07:00
James R. Barlow
2025a096c3
Test case for stdin streaming
2016-08-25 14:46:54 -07:00
James R. Barlow
38fe14b108
Make final PDF/A output message less obtuse
2016-08-25 14:46:40 -07:00
James R. Barlow
1b7b2f3695
v4.2.2 release notes, documentation improvements
2016-08-25 14:46:09 -07:00
James R. Barlow
5d67cc76cc
Update 4.2.1 release notes
2016-08-24 14:16:22 -07:00
James R. Barlow
27a3813207
Recover input filename from symlink on error message
...
The recent commit to accept files from stdin broken the feature of
returning the input filename on an error, returning the temp filename
instead, which is confusing.
2016-08-23 17:38:28 -07:00
James R. Barlow
b06e0bfdcd
Merge branch 'develop'
2016-08-23 16:03:07 -07:00
James R. Barlow
d616f25324
Implement DPI checking for stencil masks
2016-08-23 15:59:34 -07:00
James R. Barlow
b03028e31f
setup.py -> license is MIT
2016-08-19 10:14:33 -07:00
James R. Barlow
e08c42fd3d
Tweak pipeline again
2016-08-09 22:40:29 -07:00
James R. Barlow
16901f7134
Accept input from stdin if input filename is '-'
2016-08-09 15:46:24 -07:00
James R. Barlow
dffceedd85
Update the pipeline image
2016-08-09 15:45:19 -07:00
James R. Barlow
e5541e435c
New test to confirm we can emit JBIG2 with appropriate settings
2016-08-03 11:35:48 -07:00
James R. Barlow
b969aad67b
Tweak release notes
2016-08-03 03:36:45 -07:00
James R. Barlow
e70387b1af
Add a simple test for image to PDF
2016-08-03 03:35:30 -07:00
James R. Barlow
44f47fba21
PDF/A: handle case of no XMP metadata gracefully
2016-08-03 02:57:25 -07:00
James R. Barlow
02584094a1
Suppress NUL bytes in metadata from input files
2016-08-03 02:47:44 -07:00
James R. Barlow
91d715ac93
Add test cases for --output-type
2016-08-03 02:47:18 -07:00
James R. Barlow
35addb8a33
Complain if Chinese is requested with settings known to not work
...
Should extend test for other Asian languages
2016-08-03 01:29:12 -07:00
James R. Barlow
d32ea8d0dd
Remove dead code from qpdf merge + PyPDF2 metadata patching
...
I tried "qpdf merge + PyPDF2 metadata patching" first. The problem is
that PyPDF2 produces a 1.3 by default and generally I have less
confidence it.
New approach is to stuff the Document Info metadata in the first page
with PyPdf2, cross fingers and use qpdf to merge. It's not quite as
clean and might harm the first page, but it's better than shipping
files produced by PyPDF2.
2016-08-03 01:28:27 -07:00
James R. Barlow
12575d594a
Improve PDF/A validity checking at end
2016-08-03 01:26:16 -07:00
James R. Barlow
0746083301
Fix failing test case - unbound local variable in finally block
2016-08-03 01:00:38 -07:00
James R. Barlow
5c99acf6d1
Experimental change to use qpdf to merge files (disables Ghostscript)
...
All but one tests pass, test_input_file_not_a_pdf
Not sure if PyPDF2 metadata generation will mangle the first page.
2016-08-03 00:56:44 -07:00
James R. Barlow
2b10df7b74
leptonica: note about when it may be safe to drop <1.72 workaround
2016-08-03 00:54:37 -07:00
James R. Barlow
ebe68de4ff
Functional qpdfmerge with PyPDF2 for DocumentInfo block
...
Tests mostly passing. For the moment this is the new default.
Although PyPDF2 produces a PDF-1.3 which will be wrong for some contents
and possible should be repaired with qpdf. Again.
Looks like it could work better to merge PyPDF2 and fix everything
with qpdf.
2016-08-02 16:48:13 -07:00
James R. Barlow
b17c6a146d
Experimental qpdf merging
...
Does not copy /Catalog metadata, but otherwise functional
2016-08-02 02:19:02 -07:00
James R. Barlow
46d837c866
Clarify trusty/precise stuff
2016-08-02 01:29:33 -07:00
James R. Barlow
24856b61e4
Fix typo in readme
2016-08-02 01:29:22 -07:00
James R. Barlow
8d0c6ff616
pyvenv -> python3 -m venv
...
Sadly the Python developers are removing this script
2016-08-02 01:27:50 -07:00
James R. Barlow
0b24f971cd
ocrmyimage: complain about ICC profiles being presumed
2016-08-02 01:22:36 -07:00
James R. Barlow
bc5d3824bd
Don't overload --oversample, use --image-dpi instead for images
2016-07-31 02:09:30 -07:00
James R. Barlow
4356983707
Suppress overly long stack traces on traverse_ruffus_exception
2016-07-31 02:06:44 -07:00
James R. Barlow
2414b79ee6
More cleanup of exception related errors
2016-07-31 01:48:13 -07:00
James R. Barlow
968e1546f0
Refactor image file triage
2016-07-31 01:47:57 -07:00
James R. Barlow
48213c9c3f
Update release notes and readme
2016-07-29 15:25:16 -07:00
James R. Barlow
f385772d21
Refactor "is this an iterable that's not a string?" test
2016-07-29 15:25:02 -07:00
James R. Barlow
d257c83520
Most tests were failing at split_pages()
...
It seems that ruffus sometimes decides to send a ['inputfile.pdf']
instead of a bare string.
2016-07-29 14:59:17 -07:00
James R. Barlow
7b72ffec4f
ocrmyimage: better handling of missing/invalid DPI
2016-07-29 14:38:07 -07:00
James R. Barlow
757f6826dc
ocrmyimage - Attempt conversion to PDF if input file is not a PDF
...
First cut.
May have broken ruffus errors again too.
2016-07-29 14:03:19 -07:00
James R. Barlow
5df83a0d30
Travis: use Python 3.5 too
2016-07-29 13:31:40 -07:00
James R. Barlow
d70e3d3753
ruffus exceptions: for clarity only, don't iterate strings
...
It's a good habit to ensure any iterator test is explicit about
allowing or disallowing strings.
2016-07-29 13:31:24 -07:00
James R. Barlow
0dfceedcfb
Remove old OCRmyPDF 2.x from release notes; update 4.2 notes
2016-07-29 03:08:59 -07:00
James R. Barlow
2c30f4bfc5
Travis: build partly working on trusty; tweak requirements again
...
The build is #122
https://travis-ci.org/jbarlow83/OCRmyPDF/builds/148255615
Errors seem to be related to either Ghostscript or leptonica? Maybe
-dSAFER?
2016-07-29 03:08:01 -07:00
James R. Barlow
9e7fb52b47
Travis: add PPA to support unpaper
2016-07-29 01:57:12 -07:00
James R. Barlow
bb5fd38e38
Remove additional PPA's and try again
2016-07-29 01:47:56 -07:00
James R. Barlow
7c8cf5cfa2
Try travis-trusty
...
This removes some backports for packages that Ubuntu trusty offers but
for which Ubuntu precise needed help.
2016-07-29 01:44:57 -07:00
James R. Barlow
fef35e4eb2
Fix handling of DPI for rare case of JPEG recompression after deskew/clean
...
This test is exercised by page 4 of multipage.pdf. If all images are
JPEGs, and one of deskew/clean removes DPI information, make sure that
we can get the right information back and that the DPI stays square.
2016-07-29 01:34:52 -07:00
James R. Barlow
8f77576dc4
Fix non-square image resolution for "hocr" case; use img2pdf 0.2.1
...
Tesseract renderer not immediately fixable.
2016-07-28 16:43:51 -07:00
James R. Barlow
b3fcf24a26
Refactor DPI: fix regressions in test suite
...
Some called functions are particular about the data format of DPI and
don't like to deal with the Decimal() returned by PyPDF2. Convert to
float and int where needed.
2016-07-28 00:19:32 -07:00
James R. Barlow
16e4d342d2
Bug fix: --force-ocr should still run on pages with no images
...
Useful for people who want to reprocess text.
This also requires --oversample because DPI is undefined. To be fixed
in next commit.
2016-07-27 15:06:49 -07:00
James R. Barlow
8458a51860
Tighten requirements and dependencies
2016-07-27 14:47:59 -07:00
James R. Barlow
636d1903b3
Ghostscript: do raster output with -dSAFER
...
-dSAFER does not work when rendering PDF/A, because that needs to load
the ICC file, and -dSAFER prevents access to external files.
2016-07-27 00:54:40 -07:00
jbarlow83 and GitHub
514efa36fc
Readme: Add table of contents, brew install tesseract --with-language packs
2016-07-24 11:21:46 -07:00
James R. Barlow
bd48f40d3d
v4.1.4 release notes
2016-07-17 00:35:06 -07:00
James R. Barlow
c02dbc809a
Merge commit '68cf9cbd87c188823027f9d1bfe9029017e7281f' into develop
2016-07-17 00:29:48 -07:00
James R. Barlow
410111d6fb
Bug fix: Monochrome images with ICC treated as full color images
...
Issue #79 .
User submitted PDF with ICC profile attached to the monochrome image
in the input file, which is not common but useful for PDFs that want to
define how light the paper is or how dark the black is. The code was
written to assume unusual images are full color unless it can prove
otherwise. Handle this simple case. Other ICC cases should be tested.
2016-07-17 00:29:32 -07:00
jbarlow83 and GitHub
68cf9cbd87
.rst: add code-block markup
2016-07-05 14:03:55 -07:00
jbarlow83 and GitHub
c9b2540d9d
Fix some .rst formatting errors
2016-07-05 13:48:19 -07:00
jbarlow83 and GitHub
1bacf35a2c
Update license information for encrypted_algo4.pdf
2016-06-24 14:25:15 -07:00
jbarlow83 and GitHub
8aef0d9277
Merge pull request #76 from Jmuccigr/patch-2
...
Adding explicit reference to help
2016-06-24 14:21:23 -07:00
John Muccigrosso and GitHub
b2fa8645ba
Adding explicit reference to help
2016-06-24 13:44:12 -05:00
James R. Barlow
c96823a648
v4.1.3 release notes
2016-06-23 13:47:56 -07:00
James R. Barlow
3807b7d655
Merge branch 'feature/leptfun' into develop
2016-06-23 13:45:35 -07:00
James R. Barlow
a45505cf1d
Fix order of operations in matrix multiplication
...
Issue #73 . The order of operations happens to not matter for scaling
but does matter for translation. We only need scaling to find the DPI,
so the error was not noticed. Mainly useful to other uses of this
library.
2016-06-23 13:36:23 -07:00
James R. Barlow
b4a734fc0d
Test case for "algorithm 4" test
...
Algorithm 4 -> PDF version 1.6
2016-06-23 13:21:26 -07:00
James R. Barlow
bbd02926e1
Add helpful error message for PDFs that use algorithm 4
2016-06-23 13:13:17 -07:00
jbarlow83 and GitHub
5022ded276
Update Windows directions
2016-06-16 15:15:46 -07:00
James R. Barlow
c7612152ef
leptonica: pillow interop
2016-06-06 23:55:23 -07:00
James R. Barlow
af91642cd1
lept: fix __getstate/__setstate
2016-06-06 23:55:23 -07:00
James R. Barlow
9c66334c38
Leptonica - ortho rotate, background norm
2016-06-06 23:55:23 -07:00
James R. Barlow
8d79b94b84
cpix -> _pix
2016-06-06 23:55:23 -07:00
James R. Barlow
d7f60b96c1
More leptonica functions for page manipulation
2016-06-06 23:55:23 -07:00
James R. Barlow
b964999427
Update filename references from sRGB_IEC to sRGB
2016-05-10 21:58:04 -07:00
James R. Barlow
3473345ea6
Replace sRGB_IEC with MIT license compatible sRGB
...
New file is from Debian package icc-profiles-free
2016-05-10 21:48:32 -07:00
James R. Barlow
349ec5c81f
Provide more helpful error message if pypdf can't merge pages
2016-04-28 14:02:12 -07:00
James R. Barlow
ff78d7c56c
v4.1 release notes
2016-04-28 00:46:16 -07:00
James R. Barlow
ff092c8629
Fix race condition between these tests when run in parallel
2016-04-28 00:39:15 -07:00
James R. Barlow
fe14cb57c0
Fix ruffus exception output
...
I found this issue in ruffus 2.6.3
https://github.com/bunbun/ruffus/issues/65
also discussed here
https://github.com/bunbun/ruffus/pull/67
ruffus 2.6.3 RethrownJobError don't follow the normal conventions and
so its exception causes problems when they cross process boundaries.
This change carefully examines the various forms of ruffus exception
objects that can appear in 2.6.3 and parses them more carefully. It
also removes any direct posting of the exception to the logger because
this triggers another serializing of the exception object, mutating it
further.
2016-04-28 00:38:50 -07:00
James R. Barlow
507fbc01d5
Refactor _find_page_images
2016-04-27 13:13:43 -07:00
James R. Barlow
325479e5be
Fix test failure: inline images with multiple image filters specified
2016-04-27 13:09:41 -07:00
James R. Barlow
e926ecb8b2
Fuzzing: check for graphics stack overflow
...
Very unlikely to occur
2016-04-18 13:08:35 -07:00
James R. Barlow
d0cb6c0e92
Replace private hypotenuse formula with hypot()
2016-04-18 13:07:53 -07:00
James R. Barlow
5b7c8cf5d3
Remove check for /ImageMask
...
/ImageMask means the the image is a stencil mask for a grayscale or
color image. From issue #63 a user has a PDF apparently with only a
stencil mask and no other images. According to PDF spec you're supposed
to use masks to help draw other images rather than draw masks
explicitly, although drawing masks is not forbidden.
In the event that the image mask is higher resolution than the input
image, the composite image should be drawn at the highest DPI to a
ccurately capture the effect of the mask. It looks like the right to
do is take masks into account rather than ignore them (a holdover
from earlier, less robust versions), or don't treat it different.
2016-04-14 14:24:33 -07:00
James R. Barlow
40baab32ac
Remove dead code "import stuff in testcase"
2016-04-14 14:22:34 -07:00
James R. Barlow
e877d37ac8
--rotate-pages: Only apply rotation if we're reasonable confident
...
Take the threshold from tesseract's default value for -psm 1.
2016-04-14 13:49:44 -07:00
James R. Barlow
5a9f77e438
Merge commit '1605408c23fa1b9252c5d3f10f279b43733b0728' into develop
2016-04-14 13:07:10 -07:00
James R. Barlow
8ddd67d1e2
Check encoding of inline images
2016-03-24 15:11:10 -07:00
jbarlow83
1605408c23
README: add libffi-dev
2016-03-22 23:39:02 -07:00
James R. Barlow
2d3b1ebf6e
Simplify DPI calculation with algebraic derivation
...
Needs testing
2016-03-20 12:35:41 -07:00
James R. Barlow
c74eaab7f5
Update license: sRGB ICC
2016-03-20 12:34:34 -07:00
James R. Barlow
c21d231388
Merge commit 'a73afc4e769202b916d35dee481d741cf6bb7224'
2016-03-20 12:33:15 -07:00
jbarlow83
a73afc4e76
Merge pull request #59 from spwhitton/apt-get
...
README: Debian and Ubuntu installation option
2016-03-14 00:19:59 -07:00
Sean Whitton
76c364150d
README: Debian and Ubuntu installation option
2016-03-13 23:15:00 -07:00
James R. Barlow
94a3e447cc
Add otsu threshold to leptonica
2016-03-12 00:09:20 -08:00
James R. Barlow
12868b461a
Travis: install unpaper.deb instead of compiling from source
2016-03-11 21:16:01 -08:00
James R. Barlow
322085933b
unpaper: fix check for missing and old versions, add test case
2016-03-10 15:37:09 -08:00
James R. Barlow
3fed94bb79
v4.0.7
2016-03-02 06:27:01 -08:00
James R. Barlow
8c877482bd
Fix leptonica initializers
2016-03-02 06:26:25 -08:00
James R. Barlow
b17d589e84
Don't set -sOutputICCProfile
...
Ghostscript dev advised against. It appears that this is for
creating target for a device that colors in a particular format.
2016-03-02 06:25:34 -08:00
James R. Barlow
368252a243
setuptools_scm_git_archive seems suddenly broken
2016-03-01 02:09:45 -08:00
James R. Barlow
ccefda1bee
v4.0.6 notes
2016-03-01 01:58:32 -08:00
James R. Barlow
3d0e8c9629
Provide our own sRGB profile instead of Ghostscript's
2016-03-01 01:27:40 -08:00
James R. Barlow
313bbbb94c
setup_scm_git_archive: add additional files
2016-02-29 12:46:27 -08:00
James R. Barlow
0360f078de
get_postscript_icc_path: don't check the same path multiple times
2016-02-29 12:45:58 -08:00
James R. Barlow
c8901666c4
Merge branch 'master' of https://github.com/jbarlow83/OCRmyPDF
2016-02-29 00:06:07 -08:00
James R. Barlow
7430006596
Improve install instructions for OS X (unpaper)
2016-02-29 00:05:31 -08:00
James R. Barlow
f3e06b2dbd
Add bookmarks to file for more testing
2016-02-29 00:05:07 -08:00
jbarlow83
e97df307ff
Merge pull request #54 from stweil/master
...
Replace broken link to c't article by permalink
2016-02-28 07:18:40 -08:00
Stefan Weil
1443354aa2
Replace broken link to c't article by permalink
...
Update also the 2nd article link to use a permalink, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de >
2016-02-28 13:57:42 +01:00
James R. Barlow
250e68c1cd
v4.0.5 release notes
2016-02-27 01:01:38 -08:00
James R. Barlow
6a380ee99c
Fix temporary file placed in wrong folder
2016-02-27 00:51:47 -08:00
James R. Barlow
3c90bd96a9
Remove extraneous debug print() messages
2016-02-27 00:50:58 -08:00
James R. Barlow
06a7ceb25a
v4.0.4 Updates release notes
2016-02-27 00:22:37 -08:00
James R. Barlow
733a8e7d58
Merge branch 'feature/parsecontent'
2016-02-27 00:19:19 -08:00
James R. Barlow
570bbe9a05
Add comments and remove debugging, improve inline handling
...
Squashed commits:
[bfff3c9] pageinfo, have a main()
2016-02-27 00:18:36 -08:00
James R. Barlow
5cc3adb39a
Add support for inline images
2016-02-27 00:18:36 -08:00
James R. Barlow
3957a0606c
Compute image pixel density without performing rectangle intersection (+5 squashed commits)
...
Squashed commits:
[0e27904] Partially implement DPI calculation with rotation of the image
Fixes test suite
[a64f662] pageinfo: all tests pass
[c5b811a] Fix typos
[cdd2286] Can now find inline images for efficiently
[60dde8d] First cut at implementing intelligent DPI detection based on content stream
Broke many of the test cases
2016-02-27 00:18:36 -08:00
James R. Barlow
11a561dbce
v4.0.3 release notes
2016-02-26 01:12:15 -08:00
James R. Barlow
dad2198394
Log information about detected page orientations in a summary line
2016-02-26 01:07:59 -08:00
James R. Barlow
e40fdc502d
Always dump stack trace for unexpected errors
2016-02-26 01:06:59 -08:00
James R. Barlow
d446fe5922
Fix "too few characters" reported as error by tesseract -psm 0
2016-02-21 08:53:34 -08:00
James R. Barlow
4ca90c106d
Docker: fix blank JPEG2000 PDF issue
2016-02-21 04:24:21 -08:00
James R. Barlow
7c5e58a497
Fix test cases that break in Docker, improve test for running in Docker
2016-02-20 23:47:37 -08:00
James R. Barlow
323b9a5f8e
Add other missing files
2016-02-20 05:34:21 -08:00
James R. Barlow
cab381a339
Add JPEG 2000 test case
2016-02-20 05:13:19 -08:00
James R. Barlow
fe4d4c39cd
Merge commit '6f3ac46b1c176d48782347cfa14d9ef6ce773f37' into develop
2016-02-20 04:56:12 -08:00
James R. Barlow
ad188d7ae1
Docker: supply openjpeg to address JPXDecode errors
2016-02-20 04:54:55 -08:00
James R. Barlow
8246cc0538
Gracefully recover from tesseract's failure to process very large images
...
And test cases to check this
2016-02-20 04:53:23 -08:00
James R. Barlow
6f3ac46b1c
Gracefully recover from tesseract's failure to process very large images
...
And test cases to check this
2016-02-20 04:53:02 -08:00
James R. Barlow
ac71c3be63
4.0.2rc1 - release notes, add missing file caught by Travis
2016-02-20 03:36:37 -08:00
James R. Barlow
ecc0ac9b19
Fix error on --tesseract-timeout timing out
2016-02-20 03:13:23 -08:00
James R. Barlow
ea4e6bf67d
leptonica: serialization tweaks, memory handling
2016-02-20 02:54:53 -08:00
James R. Barlow
46c204f533
Fix leptonica pickling
2016-02-20 02:35:34 -08:00
James R. Barlow
71fbda8bf6
Adjust page orientation parsing to deal with change in Tess 3.04.01
2016-02-20 01:32:56 -08:00
James R. Barlow
9b79b4a7c8
Leptonica: documentation, helper functions
2016-02-20 01:20:06 -08:00
James R. Barlow
c04cc853d7
leptonica: remove special PNM handling
...
We no longer use PNM as an intermediate format, so there's no need to
handle leptonica's PNM quirks.
2016-02-19 15:13:14 -08:00
James R. Barlow
dd41e70ccc
leptonica: nit
2016-02-19 15:11:48 -08:00
James R. Barlow
4206e74f42
tests: also check that monochrome correlation correctly detects matches
2016-02-19 14:35:31 -08:00
James R. Barlow
68c3ce56a9
Don't do chmod unless necessarily (breaks py.test on Docker)
2016-02-19 14:09:56 -08:00
James R. Barlow
ab0e5fa425
Improve error checking for tesseract -psm 0 (orientation) errors
2016-02-19 03:58:39 -08:00
James R. Barlow
f3b0434a87
Improve ability to capture error messages from tesseract on a crash
2016-02-19 03:48:49 -08:00
James R. Barlow
aa394440db
Just use the PyPI version of ocrmypdf in dockerfile
...
Apparently setuptools_scm_git_archive is ineffective on hub.docker.com
automatic build, it still can't find a version.
2016-02-17 15:14:23 -08:00
James R. Barlow
3b98a1a04b
Fix KeyError on unexpected tess output
2016-02-17 06:05:27 -08:00
James R. Barlow
fcb89b0c58
Forgot to save release notes
2016-02-17 01:48:25 -08:00
James R. Barlow
ac65d6a03a
v4.0: release notes
2016-02-17 01:21:17 -08:00
James R. Barlow
2103f60906
Merge branch 'release/v4.0.0'
2016-02-17 01:13:24 -08:00
James R. Barlow
e3c3d848c1
Save Dockerfile comment
2016-02-17 01:11:41 -08:00
James R. Barlow
d4ef3411e0
Suppress --pdf-renderer tesseract warning in Docker image
...
Since the corrected font is provided in the Docker image, there's no
reason to show the warning.
2016-02-17 01:03:20 -08:00
James R. Barlow
71d616e413
Restore Dockerfile on local and probably on automated build as well
2016-02-17 00:13:45 -08:00
James R. Barlow
fe651d1bf5
Overwrite Tesseract 3.04 default pdf font with better pdf font
2016-02-16 21:45:44 -08:00
James R. Barlow
582ba8cfad
Provide sharp2.ttf for Docker images
2016-02-16 21:45:17 -08:00
James R. Barlow
d23291650a
Remove duplicate line from documentation
2016-02-16 14:30:15 -08:00
James R. Barlow
812fd745b6
Remove redundant line from resources
2016-02-16 14:29:56 -08:00
James R. Barlow
a87aa71d85
Remove old documentation about Pillow not linking jpeg, zlib
...
As of Pillow 3.0.0 this is fixed, so make Pillow 3 a requirement
2016-02-16 14:29:31 -08:00
James R. Barlow
60b2eb1455
Fix JPEG DPI: Pillow expects dpi=(x,y)
2016-02-16 07:29:20 -08:00
James R. Barlow
ab3c1988c1
Work around Leptonica < 1.72 bug that breaks Travis
2016-02-16 07:03:50 -08:00
James R. Barlow
ee5223eea8
Travis again: are invalid correlation measurements a use-after-free?
...
Try explicitly casting the value to a float.
2016-02-16 06:09:48 -08:00
James R. Barlow
edd2185268
Fix pytest-runner not understanding 'norecursedirs'
...
As discussed here
https://github.com/pytest-dev/pytest-runner/issues/7
and sort of
https://github.com/pytest-dev/pytest/issues/567
2016-02-16 05:44:55 -08:00
James R. Barlow
35b1ca2be2
Travis: try replacing non-standard invocation of py.test
...
It seems the normal thing to wire up python setup.py test to invoke
the test suite rather than py.test. This may be the reason for the
past chain of cffi-related commits.
2016-02-16 05:36:14 -08:00
James R. Barlow
71e493a810
Fix case of JPEG missing DPI field
2016-02-16 05:29:32 -08:00
James R. Barlow
6178e22e7f
Travis: force compile leptonica?
2016-02-16 05:24:46 -08:00
James R. Barlow
ef0aab060a
Make debug output more verbose on failure
2016-02-16 05:17:18 -08:00
James R. Barlow
d70ce61cfd
Travis: maybe it's just the missing __init__.py?
2016-02-16 05:09:12 -08:00
James R. Barlow
8cd84afac8
Revert "Try moving leptonica build script, playing with wheels a bit"
...
This reverts commit ec2c6c312b .
2016-02-16 05:04:20 -08:00
James R. Barlow
ec2c6c312b
Try moving leptonica build script, playing with wheels a bit
2016-02-16 04:05:58 -08:00
James R. Barlow
3946bba318
Too soon, try again
2016-02-16 03:51:08 -08:00
James R. Barlow
2ed0b78a7b
Travis: are you creating _leptonica.py?
2016-02-16 03:47:35 -08:00
James R. Barlow
ed346d032c
Does Travis need explicit install libffi-dev?
2016-02-16 03:41:11 -08:00
James R. Barlow
acd645f192
Fix travis syntax error
2016-02-16 02:42:47 -08:00
James R. Barlow
88433e4c34
Fiddle with travis, try to get better debug output
...
Essentially cffi failed somehow, not clear how
2016-02-16 02:12:14 -08:00
James R. Barlow
1224af1780
Update test resources to address files with unknown source
...
-Remove Test_Issue_28.pdf (inherited from fritz-hh, source unknown)
-Replace missing_docinfo.pdf (received from user, but it's a printout of
a website; unclear status, so created a new PDF with the same effect)
-Others are okay
2016-02-16 00:28:28 -08:00
James R. Barlow
ab13342931
Revise rotation tests in prep for adding a few more
2016-02-15 17:17:43 -08:00
James R. Barlow
d7913da484
Test case: remove filename conflict
2016-02-15 16:49:28 -08:00
James R. Barlow
c50e3f1329
Complain about older tesseracts that don't have sharp2.ttf installed
2016-02-15 16:43:41 -08:00
James R. Barlow
a62f86dbd7
Update release notes
2016-02-15 16:43:14 -08:00
James R. Barlow
33b88b18db
Update the notes
2016-02-15 14:03:59 -08:00
James R. Barlow
7c691c21ab
Fix image layer rotation for pages with nonzero crop boxes
2016-02-10 17:48:33 -08:00
James R. Barlow
4ec51729d8
Partial fix for images not anchored to (0, 0)
2016-02-10 17:14:48 -08:00
James R. Barlow
07b41e479a
Cleaner access to mediabox
2016-02-09 02:19:05 -08:00
James R. Barlow
6510bcad19
DPI information not transferred automatically from PNG to JPEG
2016-02-09 02:18:54 -08:00
James R. Barlow
265d2ce39b
Better skewed image
2016-02-08 23:44:46 -08:00
James R. Barlow
1928a64cae
Better logging output for autorotation
2016-02-08 23:42:25 -08:00
James R. Barlow
11e575a5a3
leptonica: suppress debug output
2016-02-08 23:41:45 -08:00
James R. Barlow
7fbc0d6460
tesseract: unify logging function
2016-02-08 23:40:36 -08:00
James R. Barlow
1ba8b1aa4b
unpaper is lousy at deskewing, so let leptonica do it
2016-02-08 15:26:33 -08:00
James R. Barlow
3569c76c0f
Also include cardinal.pdf
2016-02-08 15:23:04 -08:00
James R. Barlow
16c7ac2582
Fix test_deskew for new Leptonica API
2016-02-08 15:20:01 -08:00
James R. Barlow
4ceb59215f
Leptonica: classes are better
2016-02-08 15:14:44 -08:00
James R. Barlow
2e6879ee51
Introduce Leptonica class for Pix
2016-02-08 14:52:01 -08:00
James R. Barlow
66fc2e9d7d
Add rotate 180 correlation sanity check
2016-02-08 13:10:11 -08:00
James R. Barlow
2c7a6e574f
Shorten names of _make_input/output
2016-02-08 12:57:26 -08:00
James R. Barlow
78c3bf5dba
Check autorotate using leptonica correlation
2016-02-08 12:55:50 -08:00
James R. Barlow
98c115e3bb
Cache wasn't enabled properly for test_autorotate
2016-02-08 12:55:28 -08:00
James R. Barlow
2752bda80b
Merge branch 'feature/leptdeskew' into feature/logging
...
Need leptonica for testing now, I think
# Conflicts:
# ocrmypdf/tesseract.py
# requirements.txt
# setup.py
2016-02-08 12:34:48 -08:00
James R. Barlow
7c0940609a
Take a stab at writing test case for autorotate
2016-02-08 12:32:39 -08:00
James R. Barlow
d30a879e2d
Fix test suite by running select_image_for_pdf unconditionally
...
The purpose of this change that caused the problem was a minor
optimization for the tesseract renderer path that had it pull an image
from select_image_for_pdf so that it could use a JPEG instead of PNG,
instead of taking it from preprocess_clean where it would only get a PNG
and make large files.
2016-02-08 02:33:03 -08:00
James R. Barlow
b907234d5c
Update tesseract spoofing to cache orientation and script detection checks
...
No cache: 269 s
With cache: 144 s
test_oversample[tesseract] now fails, all others good
2016-02-08 02:21:56 -08:00
James R. Barlow
b0114c9174
More logging improvements
2016-02-08 01:31:15 -08:00
James R. Barlow
d2ba8c501f
Restore invisibletext for normal output
2016-02-08 01:14:39 -08:00
James R. Barlow
6a7ed7d359
Make logging output a lot more useful
2016-02-08 00:58:14 -08:00
James R. Barlow
6289afa1a6
Better: custom logging factory to avoid whatever ruffus is doing
2016-02-08 00:18:52 -08:00
James R. Barlow
9bb6fa04cb
Return logging to a semblance of normalcy
2016-02-08 00:09:31 -08:00
James R. Barlow
afb6f6f5c9
Render preview as .jpg instead of .png
...
Smaller file size of JPEG seems to help performance, although the
difference is only about 1%.
2016-02-07 15:49:10 -08:00
James R. Barlow
8a69671dbd
Suppress debug message
2016-02-07 15:43:57 -08:00
James R. Barlow
178aee4687
Make rotation optional (for now it's off, possibly should be on)
2016-02-07 15:43:45 -08:00
James R. Barlow
8484caddfb
Tweak pipeline, allowing --pdf-renderer to use JPEGs instead of PNGs
2016-02-07 15:36:51 -08:00
James R. Barlow
08313316de
Cleanup auto-rotation
2016-02-07 15:06:54 -08:00
James R. Barlow
1d0eca5c63
All four rotation directions working
2016-02-07 06:09:01 -08:00
James R. Barlow
fe89232a30
Fix autorotate for some lossless cases
2016-02-07 05:59:46 -08:00
James R. Barlow
4b51b521e2
Implement autorotate (provided lossless reconstruction is disabled)
...
Works for a single page file, probably
Although arguably rotation is not quite lossless, and the two could be
mutually exclusive anyway, so maybe this is it. Did not check in some
debugging changes (lossless=False, text debugging=True)
PyPDF seems to get merging wrong when one of the pages is rotated.
2016-02-07 03:27:33 -08:00
James R. Barlow
e9ec458304
tesseract: add command to access OSD values
2016-02-07 03:21:32 -08:00
James R. Barlow
54b0ddd787
ghostscript: don't try to "help" autorotation
...
It uses text direction alone -- unreliable guide.
2016-02-07 03:20:42 -08:00
jbarlow83
93bec22f9c
README: mention polyglot, fix container vs image
2016-02-07 00:32:20 -08:00
James R. Barlow
0dc96442d8
Fix img2pdf usage in test case (to make Travis CI happy again)
2016-02-06 23:41:32 -08:00
James R. Barlow
58f4582517
More Dockerfile repair
...
I'm not fully happy with this arrangement, as it effectively downloads
OCRmyPDF twice, not to mention the lengthy setup time overall.
Will need to try separate build/run images in the future, but now just
get it working again.
2016-02-06 23:13:16 -08:00
James R. Barlow
2d15c09cca
Merge branch 'develop'
2016-02-06 18:18:49 -08:00
James R. Barlow
04cb8865b0
Fetch application from PyPI instead of local
...
setuptools_scm barfs because it can't find the version, because Docker hub
retrieves the application from Github in a way that omits the necessary
details.
I suppose there is a certain logic to Docker only using the tagged
released versions from PyPI, so go with it. The other attractive option
is to nix setuptools_scm.
2016-02-06 18:18:30 -08:00
James R. Barlow
6fe32bbaf7
v3.2.1
2016-02-05 16:10:18 -08:00
James R. Barlow
4abb20390d
Bump Dockerfile versions
2016-02-05 16:08:26 -08:00
James R. Barlow
daa3916430
Fix img2pdf 0.2 usage
...
All tests pass when forced to rely on img2pdf, so seems okay
2016-02-05 15:13:26 -08:00
James R. Barlow
e9b87cefcc
Try img2pdf 0.2
2016-02-05 14:38:37 -08:00
James R. Barlow
60593b5ad3
Tighten up package requirements to deal with incompatible img2pdf 0.2 release
2016-02-05 14:37:05 -08:00
James R. Barlow
f708b11ea4
Fix Python 2.7 warning
2016-02-05 02:34:49 -08:00
James R. Barlow
7982f58b2e
Try tweaking Dockerfile for automated build again
2016-02-05 01:38:59 -08:00
James R. Barlow
e805c1908a
Minor fix for Dockerfile polyglot
2016-02-05 00:52:27 -08:00
James R. Barlow
cb3ba8e973
Merge branch 'release/v3.2' into develop
2016-02-05 00:10:41 -08:00
James R. Barlow
344fc40cbc
Merge branch 'release/v3.2'
2016-02-05 00:10:41 -08:00
James R. Barlow
7e5c37137b
Merge branch 'develop' into release/v3.2
2016-02-04 23:42:06 -08:00
James R. Barlow
1aae11714b
Update release notes for v3.2
2016-02-04 23:41:33 -08:00
James R. Barlow
d82f14a7aa
Update .gitignore
2016-02-04 18:51:41 -08:00
James R. Barlow
4b65e0b093
Set JPEG output quality to 95 for better transcoding
2016-02-04 18:49:09 -08:00
James R. Barlow
43b0faa830
Bug in tesseract_noop spoof: produced wrong page sizes
...
Now checks input image to ensure the implied page size of its .hocr file
matches the rest of the PDF.
2016-02-04 18:48:22 -08:00
James R. Barlow
8674c9fb20
Merge commit 'ccfbb54e8c26784e438ba2fcac2179f21e7d857b' into release/v3.2
2016-02-04 17:39:36 -08:00
jbarlow83
ccfbb54e8c
Update release notes for v3.2
...
Fix the notes
2016-02-04 17:37:30 -08:00
James R. Barlow
9893ebf889
Suppress tesseract argument printout
2016-02-04 17:26:36 -08:00
James R. Barlow
303eb3e93a
Merge commit 'ca546d70e5bff9e9b115371f7813f3c326822bd8' into release/v3.2
2016-02-04 17:25:56 -08:00
jbarlow83
ca546d70e5
Merge pull request #45 from spwhitton/hocrtransform-shebang-fix
...
fix shebang in hocrtransform.py
2016-02-04 17:21:33 -08:00
Sean Whitton
6a5ea2d64a
fix shebang in hocrtransform.py
2016-02-03 17:48:35 -07:00
James R. Barlow
ec3d92ad8e
Reorg gitignore
2016-01-30 15:28:24 -08:00
James R. Barlow
66a095d7de
Improve organization of CFFI setup
2016-01-30 15:19:40 -08:00
James R. Barlow
411981efbc
Experiment with CFFI instead of ctypes
2016-01-30 15:06:25 -08:00
James R. Barlow
350ad5210e
Leptonica: convert to CFFI
2016-01-20 15:03:07 -08:00
James R. Barlow
f3b588764e
Suppress tesseract argument printout
2016-01-20 15:02:48 -08:00
James R. Barlow
b49f5a7d77
Support optionally using leptonica to deskew
...
unpaper doesn't seem to be good at deskewing. It fails on test case
with a lot of italics. I think it also struggles on pages with a lot
of whitespace. Leptonica continues to shine here.
However, this is only a first crack at Leptonica. The leptonica module
should be redone to use cffi (more extensible).
Also considering the possibility of making all Lept calls in a forked
process to insulate the calling process from C code crashes and the
messy redirect of stdout/stderr to read Leptonica's errors.
I don't think the redirect is a huge problem as long as multiprocesses
rather than multithreads are used. The ruffus child process that is
handling a page is single threaded and will not be affected by the
redirection. It just feels dirty. The main reason to consider a child
process is crash isolation.
2016-01-19 17:43:40 -08:00
James R. Barlow
bacbcba58a
Merge branch 'release/v3.2-rc1'
2016-01-19 16:58:37 -08:00
James R. Barlow
52e8aa434f
Update release notes for v3.2-rc1
2016-01-19 16:49:49 -08:00
James R. Barlow
37c508f3f8
Better versioning: no silly version files, but wrong ver in development
...
Small price to pay.
2016-01-19 16:07:52 -08:00
James R. Barlow
26e36422cc
More fiddling with version
2016-01-19 15:07:21 -08:00
James R. Barlow
f82cb002bc
Try automatic versioning with setuptools_scm
2016-01-19 13:27:18 -08:00
James R. Barlow
c1eb047a4b
Fix name of pdfa_def.ps
...
Used to include a copy of the parent dir's name.
2016-01-19 13:11:03 -08:00
James R. Barlow
626ca18f5c
Remove stale comment
2016-01-19 13:02:35 -08:00
James R. Barlow
9058dedfbe
New tests for ccitt, jbig2 encodings
2016-01-19 13:01:56 -08:00
James R. Barlow
a0952bfca3
Optimize: use img2pdf stream instead of repeated copies
2016-01-18 20:24:46 -08:00
James R. Barlow
354e61946e
Use os.makedirs for test output directories
...
Broke Travis
2016-01-16 02:47:56 -08:00
James R. Barlow
fd6d1d748a
Merge branch 'feature/pypdf-page-merge' into develop
2016-01-16 02:33:23 -08:00
James R. Barlow
360acd1e2c
Adjust test_oversample test case
...
Add -f to force generation of the background image at the desired
oversample resolution. Our new behavior is to only send the oversampled
image to Tesseract while leaving the main page intact unless asked to
deskew, clean, etc.
2016-01-15 15:55:23 -08:00
James R. Barlow
fc0479f110
Fix all but test_oversample[hocr]
2016-01-15 15:46:47 -08:00
James R. Barlow
62728205b6
Implement image+text merging in other cases
...
5 failed, 28 passed
failures:
test_oversample[hocr], test_skip_ocr, test_skip_big, test_maximum_options[hocr],
test_blank_input_pdf,
2016-01-15 15:38:08 -08:00
James R. Barlow
dc0fb25e64
Render hocr page: no longer needs an image as input
2016-01-15 15:16:47 -08:00
James R. Barlow
f3e04cce56
Update pipeline.svg
2016-01-15 14:56:16 -08:00
James R. Barlow
7067110308
Add safety check to prevent merge from running when not sensible
2016-01-15 14:54:45 -08:00
James R. Barlow
599d889703
Implement "perfect reconstruction" - transfer page and watermark OCR layer
...
Works, does not account for changes to clean/deskew, etc.
Surprisingly, it works. PyPDF2 fixes since last attempt?
2016-01-15 14:39:12 -08:00
James R. Barlow
2fa8366632
Merge branch 'feature/test-pageinfo-cleanup' into develop
2016-01-15 14:18:01 -08:00
James R. Barlow
c368c51bad
New hocrtransform test
2016-01-15 14:14:08 -08:00
James R. Barlow
7c558b3713
Move pageinfo test into tests folder
2016-01-11 17:40:44 -08:00
James R. Barlow
8d323ae510
Merge branch 'feature/pagesegmode' into develop
2016-01-11 17:23:00 -08:00
James R. Barlow
3b53e9adac
Use tesseract cache for -psm
2016-01-11 17:22:50 -08:00
James R. Barlow
074c1d71b4
Activate --tesseract-pagesegmode
2016-01-11 17:19:32 -08:00
James R. Barlow
1fca9a004d
Adjust command line parameters
...
Was splitting each argument to --tesseract-config into a list of single
character strings
2016-01-11 16:57:19 -08:00
James R. Barlow
b485a1ef78
Override ruffus' handling of --jobs
...
Ruffus treats omitted parameter as -j1. For our purposes it makes more
sense for omitting the parameter to mean "use all CPUs". As such we
must be able to distinguish -j1 from the parameter -j being omitted.
Telling ruffus to ignore the argument actually just makes it not auto
generate the argument. We can add an argument back with the same name.
2016-01-09 19:07:48 -08:00
James R. Barlow
326ef7a3ac
Merge branch 'hotfix/v3.1.1' into develop
...
# Conflicts:
# RELEASE_NOTES.rst
2016-01-09 18:55:04 -08:00
James R. Barlow
12bc58b5b6
Merge branch 'hotfix/v3.1.1'
2016-01-09 18:45:40 -08:00
James R. Barlow
6af0815681
Bump version
2016-01-09 18:45:06 -08:00
James R. Barlow
66c2b9b78e
Merge branch 'hotfix/v3.1.1' into develop
2016-01-09 18:38:09 -08:00
James R. Barlow
d03c056cb1
Supporting all languages bloats the image by an extra 1 GB
...
Make it a special image
2016-01-04 16:49:06 -08:00
James R. Barlow
3f94d628fa
Dockerfile: remove manual build of unpaper
...
Fortunately unpaper now exists as binary package, eliminating the need
to install all of the build machinery and build it from source.
2016-01-04 15:07:12 -08:00
James R. Barlow
a64c7dbe99
Update dockerfile: include all languages
...
Also update ignore files
2016-01-04 14:27:16 -08:00
James R. Barlow
61b3ccb57c
Place ruffus database in temporary folder
...
Because we don't really use ruffus checkpoint feature, putting the
database in a permanent location does not help anything, but does cause
large database files and problems if the .ruffus_history.sqlite wanted
to be in a writable location.
2016-01-04 13:23:47 -08:00
James R. Barlow
424b4b33b1
Just go right ahead and demand Python 3.4
2016-01-04 12:56:51 -08:00
James R. Barlow
e510f89792
Python 2 warning message
2015-12-21 09:38:38 -08:00
James R. Barlow
49cd6cc619
Off by one error in page info calculation
2015-12-21 09:35:02 -08:00
James R. Barlow
9aa3d340d4
Tell Travis about the cache
2015-12-17 14:02:13 -08:00
James R. Barlow
09782242c8
Adjust test cases to use cache and noop more effectively
...
This reduces total execution time to 164s on my machine, down from
about double that.
2015-12-17 14:00:17 -08:00
James R. Barlow
9ec4aa039d
Add tesseract caching to speed up tests
2015-12-17 12:52:12 -08:00
James R. Barlow
ecebe2f24b
Let some tests use the spoofed tesseract
...
Where getting OCR doesn't matter
2015-12-17 11:56:09 -08:00
James R. Barlow
7313a77c2a
Implement pdf renderer side of tess spoof
2015-12-17 11:41:54 -08:00
James R. Barlow
45113676a3
Add Tesseract spoofing
2015-12-17 11:36:47 -08:00
James R. Barlow
102bd07019
Check for encrypted PDF and complain appropriately
2015-12-17 10:37:54 -08:00
James R. Barlow
9622e31da9
Use envvars in a new test case
...
And get rid of the messy binary replacement spoofing
2015-12-17 09:29:01 -08:00
James R. Barlow
1731ce2a44
Environment variables can now override default programs
2015-12-17 09:05:10 -08:00
James R. Barlow
276f421c44
Did a quick test of Ghostscript vs QPDF at PDF page splitting
...
qpdf won so hard it wasn't funny, even though it must be called once
per page to do the job. Perhaps Ghostscript interprets it as a call to
render the page?
time bash qpdf-test.fish ../tests/resources/multipage.pdf
0.07 real 0.02 user 0.03 sys
time gs -sDEVICE=pdfwrite -dSAFER -o '%06d.pdf' ../tests/resources/multipage.pdf
5.12 real 5.06 user 0.04 sys
2015-12-17 08:49:08 -08:00
James R. Barlow
133357779a
All subprocess invocations refactored out of main.py
2015-12-17 08:31:18 -08:00
James R. Barlow
5d8167b232
Move PDF validation check to qpdf.py
2015-12-17 08:28:00 -08:00
James R. Barlow
e76ae8c46c
Move more qpdf calls into qpdf.py
2015-12-17 08:24:48 -08:00
James R. Barlow
53a7c0e668
Refactor qpdf subprocess calls into module
2015-12-17 08:19:53 -08:00
James R. Barlow
4ca243e490
Merge commit '9f374461559460527e47237323e511123f31b6b0' into feature/envvars
2015-12-17 07:27:26 -08:00
jbarlow83
9f37446155
Merge pull request #34 from shemgp/master
...
Don't exit when qpdf repairs the file successfully but displays warning
2015-12-16 20:46:47 -08:00
Shem Pasamba
d7c7559b05
Use boolean instead of integers
2015-12-17 11:23:27 +08:00
Shem Pasamba
b2b66d1344
Don't exit when qpdf repair was successful
2015-12-17 11:20:20 +08:00
James R. Barlow
5d111a3c04
Refactor tesseract --pdfrenderer calls to tesseract.py
2015-12-16 17:48:26 -08:00
James R. Barlow
10416f847f
Migrate tesseract-hocr code to tesseract module, because modularity
2015-12-16 17:36:11 -08:00
James R. Barlow
79b3472b26
All tests passed, bump version
2015-12-04 04:31:01 -08:00
James R. Barlow
f1b2f1ae08
Merge branch 'feature/pdfa-2' into develop
2015-12-04 04:04:08 -08:00
James R. Barlow
ee7d97ae8c
Trivial
2015-12-04 04:03:38 -08:00
James R. Barlow
7d9f473bb1
Remove eval() call by introspecting ExitCode
2015-12-04 03:34:53 -08:00
James R. Barlow
e77a5e5e75
We don't want threads. Really. Do. Not. Want.
2015-12-04 03:11:38 -08:00
James R. Barlow
6ab19af122
Comments
2015-12-04 03:09:39 -08:00
James R. Barlow
276fe49867
Better error messages for input file not found or invalid
...
Not as good finding a general way to deal with ruffus exceptions, but
better than nil.
2015-12-04 03:07:53 -08:00
James R. Barlow
acb31abe86
Fix issue #20 - fails on uppercase .PDF
2015-12-04 02:14:09 -08:00
James R. Barlow
4f964a3c8a
Introduce --pdf-renderer auto
...
Tess 3.03's has various quality problems like wrong DPI that are fixed
in Tess 3.04. Idea here is to introduce an option to let OCRmyPDF
select the rendering backend based on the options and system.
However, we're not ready for tesseract as the main renderer.
Setting pdf-renderer to tesseract does not pass all test cases, mainly
the one where --tesseract-timeout is triggered, and some others.
2015-12-02 23:20:31 -08:00
James R. Barlow
df1fda7438
pageinfo: workaround PyPDF extractText limitations on hidden text
...
It appears that extractText() does not find all text. At a glance it
may be that Tesseract's PDF renderer generates a font and uses glyphs
that map to different Unicode code points that PyPDF expects, so it
discards the content and finds nothing. As a proxy in lieu of better
PDF parsing, assume that a "GlyphLessFont" means there is a text there.
I had previously found it does not work to check for the presence of a
font on page. Some PDF generators create a font resource entry even if
the font is never called for.
2015-12-02 23:16:36 -08:00
James R. Barlow
d6124c1787
pageinfo: improve robustness of text test for Tesseract produced PDFs
2015-12-02 03:12:52 -08:00
James R. Barlow
80d89b5420
Set /Creator metadata to OCRmyPDF
...
with reference to Tess version and settings
2015-12-02 02:19:39 -08:00
James R. Barlow
74059eecf1
Choose PDF/A-2b by default instead of A-1b
2015-12-02 01:48:10 -08:00
James R. Barlow
78697341a2
pytest: don't run tests that happened to be part of pyvenv
2015-12-02 01:19:43 -08:00
James R. Barlow
cfb56dd8ff
Merge commit 'b1769cbe18e6380ddfe96b3b22e6d02cb603338b' into develop
2015-12-01 00:40:43 -08:00
jbarlow83
b1769cbe18
README: El Capitan supported now, Py3.5 supported
2015-11-26 16:31:33 -08:00
James R. Barlow
955b801e7f
Merge branch 'master' into develop
2015-09-14 00:34:21 -07:00
James R. Barlow
3cea3f1afe
Try to work around git binary file bug again
2015-09-14 00:34:16 -07:00
James R. Barlow
fd4a227ccb
Force this file to stop thinking it was modified
2015-09-13 17:53:01 -07:00
James R. Barlow
19c3097483
Update notes
2015-09-13 17:51:18 -07:00
James R. Barlow
cdd1a6d03c
Suppress failing test
2015-09-10 07:01:14 -07:00
James R. Barlow
5fb8411571
Try new PPA for libav
2015-09-10 06:01:59 -07:00
James R. Barlow
334a15b8c7
typo fix
2015-09-10 05:01:44 -07:00
James R. Barlow
6390736577
ffmpeg-dev instead?
2015-09-10 04:27:57 -07:00
James R. Barlow
d55a214516
Autoreconf?
2015-09-10 04:10:12 -07:00
James R. Barlow
0994164b9a
travis: apt-get install in wrong place
2015-09-06 01:43:47 -07:00
James R. Barlow
54ee0dd147
travis: fix typo
2015-09-06 01:39:54 -07:00
James R. Barlow
47c7990fb3
travis: build unpaper with cache
2015-09-06 01:38:01 -07:00
James R. Barlow
997e95de4d
travis: build unpaper
2015-09-06 01:29:07 -07:00
James R. Barlow
44204be256
Fix order of PPAs
2015-09-06 00:54:50 -07:00
James R. Barlow
9b1d9aa88a
travis: improve, add new PPA, etc.
2015-09-06 00:41:23 -07:00
James R. Barlow
b775762f6a
travis: doesn't like gcc-4.8, try just gcc
2015-09-06 00:23:05 -07:00
James R. Barlow
df1a28e319
Travis needs sudo mode
2015-09-06 00:21:20 -07:00
James R. Barlow
c300b2802a
travis: tabs -> spaces
2015-09-06 00:08:25 -07:00
James R. Barlow
01040ace4c
More complete travis.yml
2015-09-06 00:02:58 -07:00
James R. Barlow
8367172e0b
Start setting up Travis CI
2015-09-05 23:44:43 -07:00
James R. Barlow
09afd8d25d
Move to my repo: github.com/fritz-hh => jbarlow83
...
I made several efforts to contact fritz but he is no longer
communicating, and to set up Github integrations with Docker and Travis
CI I need admin access. Which I don't have. So I'm moving it to my own
and aiming the old one at me.
2015-09-05 01:14:54 -07:00
James R. Barlow
7ed60429b3
Test case: No longer using JHOVE
...
So JHOVE will not claim this is an invalid PDF and we should see it
reported as valid.
2015-09-05 01:12:33 -07:00
James R. Barlow
281eafada0
bump to v3.0 and move repos
2015-09-05 00:53:14 -07:00
James R. Barlow
c14e10128a
Bump version to -rc9
2015-08-29 16:43:22 -07:00
James R. Barlow
3270635192
ghostscript: quiet startup on rasterize
2015-08-28 04:51:36 -07:00
James R. Barlow
3d26257710
Add test cases for additional image formats
2015-08-28 04:51:11 -07:00
James R. Barlow
c4f134d694
Prevent running validation on missing file after an exception is thrown
2015-08-28 04:48:29 -07:00
James R. Barlow
83f9dfbac4
Use png256 raster device when possible
...
Someone reported a bug where the .png input to unpaper ended up being
type 'P' (palette) for some reason, which was not supported in unpaper.
Not sure how it happened, but seemed easier to fix by explicitly
supporting. Here we use png256 if it would capture all colors in the
input file. It's up to tesseract/reportlab to make use of the palette
PNG when rendering.
2015-08-28 04:47:57 -07:00
James R. Barlow
3a445ad5f7
unpaper: support paletted files by conversion instead of bailing
2015-08-28 04:44:26 -07:00
James R. Barlow
c6d106ec33
Throw exception if iccprofiles not found instead of returning None
...
So far iccprofiles were only missing for a user who had a custom and
possibly broken ghostscript installation.
2015-08-28 03:59:35 -07:00
James R. Barlow
2ce6834be4
Bump to -rc8
2015-08-24 01:25:01 -07:00
James R. Barlow
b376672dbc
Bug fix: exception thrown if input PDF was missing DocumentInfo block
2015-08-24 01:23:30 -07:00
James R. Barlow
d07db8547f
Merge branch 'master' of https://github.com/fritz-hh/OCRmyPDF
2015-08-23 12:30:46 -07:00
James R. Barlow
aab08bfcc7
Fix requirements.txt problem
2015-08-23 12:30:40 -07:00
jbarlow83
e0a25494ee
Explain the need for multi core, etc
2015-08-22 13:34:42 -07:00
James R. Barlow
fd876d5e4e
Merge branch 'develop'
2015-08-22 01:51:44 -07:00
James R. Barlow
ee7f008ff5
Require unpaper 6.1; no messing around with broken versions
2015-08-22 01:51:08 -07:00
jbarlow83
d9161a6ddb
Update README: docker run instructions
2015-08-22 01:50:13 -07:00
jbarlow83
f8d66768e3
Update README with docker install instructions
2015-08-22 01:33:12 -07:00
James R. Barlow
4f3673d14d
Update notes for -rc6
2015-08-22 00:40:07 -07:00
James R. Barlow
1712fdb74a
Merge branch 'feature/docker-debian'
2015-08-22 00:32:27 -07:00
James R. Barlow
3a5ffc79e0
Stock debian unpaper is no good; replace with 6.1 built from source
...
debian and ubuntu both install unpaper 0.4.2 or so. No .deb packages
available at higher version numbers although ArchLinux had something.
Considered making a separate image to handle building and install but
decided that was a premature optimization at this point, so just build
the unpaper that works. All tests pass.
2015-08-22 00:30:39 -07:00
James R. Barlow
859b063444
Fixup other docker test suite errors
...
Outstanding failures:
test_pageinfo::test_jpeg
tests involving unpaper due to version <6.1 failures
2015-08-20 02:37:03 -07:00
James R. Barlow
bd61e7c644
dockerignore *.pyc
...
https://github.com/docker/docker/issues/13113
Docker kinda sucks. No recursive exclusion.
2015-08-20 02:27:07 -07:00
James R. Barlow
c9abf282b5
Set docker locale to utf-8
...
Shocked, shocked, that there's a Linux distribution out that there isn't
doing the right thing and setting up utf-8 by default. (Many tests failed)
2015-08-20 01:44:30 -07:00
James R. Barlow
9dad40b5a3
Major overhaul of the Dockerfile
...
Switched from Ubuntu to debian:stretch because stretch has more recent
versions of our binary packages and starts smaller. In particular,
stretch has both pillow==2.9.0 and reportlab==3.2.0 available as system
packages which saves the considerable hassle of install a toolchain.
Instead, a pyvenv is set up with access to system's site-packages (note:
needs two steps), making the binary-dependent packages available. Then
the remaining packages are installed into the pyvenv with --no-cache-dir
to avoid saving files. And there we are.
Image is still very large (>500 MB), but programs like reportlab require
font rendering capabilities so they pull in large portions of the Linux
graphics stack. Not much will shrink that.
2015-08-20 01:25:31 -07:00
James R. Barlow
8e2d690cb0
Rework Dockerfile, setup.py to work with wheels for better cache use
2015-08-19 13:43:32 -07:00
James R. Barlow
c132e091e1
Dockerfile: use local copy of application
2015-08-19 13:10:58 -07:00
James R. Barlow
630e6cbf1e
pip chokes on Unicode filenames?
2015-08-18 23:56:30 -07:00
James R. Barlow
83ff5760a8
Dockerfile comment cleanup
2015-08-18 23:41:41 -07:00
James R. Barlow
fed0ee638e
Fix ruffus writing to RO directory in container
2015-08-18 23:30:06 -07:00
James R. Barlow
cc161780df
Replace fileinput with regular open-replace
...
fileinput is supposed to save time in these cases but it's not capable
of doing both in-place rewrites and working with a non-ascii encoding.
This was not noticed until characters outside of ASCII were picked up
by tesseract and saved in a HOCR file. Rework some surrounding code as
well and add multilingual test cases.
2015-08-18 23:27:50 -07:00
James R. Barlow
898b2b000a
Works
2015-08-18 05:38:05 -07:00
James R. Barlow
b3ee743ed7
WIP on docker
2015-08-18 04:46:25 -07:00
James R. Barlow
ef17b669fe
README needs ghostscript
2015-08-18 03:27:39 -07:00
James R. Barlow
2dff3e07ce
Drop libxml2 dependency
...
It seems that Python's internal XML parser is good enough to do the job.
2015-08-17 15:26:07 -07:00
James R. Barlow
53c88093ad
Bump to -rc5
2015-08-16 02:19:04 -07:00
James R. Barlow
0ec13d3a17
Fix test cases: minor issues
...
-os.environ directly modified when whole suite run, breaking subsequent
tests
-no longer trusting JHOVE for PDF/A validation
2015-08-16 01:57:35 -07:00
jbarlow83
0d5104049a
Update README with better install instructions
2015-08-16 01:28:28 -07:00
James R. Barlow
ce8fa69785
Update readme
2015-08-16 00:59:57 -07:00
James R. Barlow
30072e0c70
Pillow sucks
...
Far from being fluffy or friendly, Pillow silently allows installation
of itself without support for major image types. Reportlab calls for
pillow 2.4.0. On Ubuntu 14.04 LTS this will trigger an upgrade of
pillow that will be built without JPEG or ZLIB so it is effectively
neutered, and unfortunately Pillow will not detect this situation at
install time and guide users to a resolution. Instead, you see nasty
stack traces.
So add a run-time check to ensure that Pillow is sane and capable of JPEG
and PNG support since both may be used internally.
2015-08-16 00:54:03 -07:00
James R. Barlow
eb04a890b2
Relax Pillow requirement for Ubuntu 14.04 LTS
2015-08-15 15:55:56 -07:00
James R. Barlow
0c53adb04f
setup: rollback lxml version to 3.3.3 - that's the latest in Ubuntu 14.04
2015-08-15 15:25:58 -07:00
James R. Barlow
ee5a43fd47
setup: suppress jhove errors
2015-08-15 15:25:30 -07:00
James R. Barlow
c43d6c2cbe
Merge branch 'develop' of https://github.com/fritz-hh/OCRmyPDF into develop
...
Conflicts:
setup.py
2015-08-15 15:18:41 -07:00
James R. Barlow
87aeeacb04
Fix erroneous instruction to "apt-get install tesseract"
...
Should be tesseract-ocr
2015-08-15 15:17:38 -07:00
James R. Barlow
6b26e9cad6
Fix erroneous instruction to "apt-get install tesseract"
...
Should be tesseract-ocr
2015-08-15 15:12:05 -07:00
James R. Barlow
85af0f0d03
Add test case for blank PDF page
2015-08-14 00:46:50 -07:00
James R. Barlow
f6f4705ea3
Remove Java from setup.py
2015-08-14 00:44:56 -07:00
James R. Barlow
a4702bff22
Possible fix for issue #111
2015-08-13 23:10:22 -07:00
James R. Barlow
73c5c48f79
Update notes
2015-08-13 23:08:29 -07:00
James R. Barlow
adf495e8cc
Remove JHOVE
...
JHOVE is not an effective PDF/A validator, as detailed in this article:
http://www.pdfa.org/2014/12/ensuring-long-term-access-pdf-validation-with-jhove/
In short, it's buggy. Out of 670 invalid PDF/A files in a test suite,
it only flagged 5. It only looks for certain problems that Ghostscript
generated PDFs are unlikely to have. So use qpdf as a final check for
general ill-formed PDF problems since it is quite reliable.
JHOVE 1 is no longer maintained. There's a JHOVE 2 but it has no PDF
support. I also don't know if it's appropriate to bundle JHOVE, with an
LGPL, under this project and its current license.
Removing a dependency on Java is a huge win. A world with less Java is
a world with less AbstractFactoryConstructorInterfaces.
2015-08-11 15:31:32 -07:00
James R. Barlow
9247ea00bf
Improve ruffus exception handling
...
ruffus swallows the return code if the process of handling an exception
we hit an error in ruffus' own code, which can happen. So pick through
its error stack and find out if there's an interesting return code in
there. Had to use eval() of all things.
Also suppress the stack trace for normal error conditions that don't
need one.
2015-08-11 02:19:46 -07:00
James R. Barlow
a1238d7bf9
Document override binary test
2015-08-11 00:44:43 -07:00
James R. Barlow
2d63268f0f
Work around JHOVE bug for now, so that the test passes
2015-08-11 00:23:48 -07:00
James R. Barlow
1cb5f6a90d
Refactor exit codes; test for missing tessdata
...
Some versions of tesseract installed by homebrew end up without a
functional tessdata folder, and tesseract is not helpful in this
situation, so add a new test to make sure our output is at least
indicative of the problem.
In the process of properly handling return codes I discovered
test_override_metadata triggers a NPE inside JHOVE probably due to the
Unicode character checking. This could be specific to my JRE (1.6.0_65,
Oracle) but it's probably JHOVE's fault. A valid PDF/A (per Acrobat)
is still generated.
2015-08-11 00:17:02 -07:00
James R. Barlow
8d848284df
Fix code, test case: complain when GS fails to produce PDF/A
...
Modified pipeline to fix regression and return the proper error code if
we did not produce a PDF/A as expected. The wrapper forces the output
to be PDF 1.3 which is not PDF/A compliant.
The funny thing is that in some cases JHOVE incorrectly states that a
file is PDF/A-1b compliant, well formed and valid, even when it is not
according to Acrobat XI and is missing the PDF/A metadata marker, as
far as I can tell. JHOVE may not be as beneficial as hoped.
2015-08-10 16:05:00 -07:00
James R. Barlow
8fe54d1a5c
Add new test case to check invalid PDF/A case
...
It revealed a regression - return code not the same as v2.x for invalid
PDF/A. It's also not easy to get the return code out of ruffus. Will
need to tweak the final step of the pipeline.
2015-08-10 13:57:28 -07:00
James R. Barlow
11dd9f14c3
setup.py: block unsafe 'upload', say to use twine instead
2015-08-09 14:16:30 -07:00
James R. Barlow
16d24f1166
Bump version to -rc4
2015-08-05 23:26:38 -07:00
James R. Barlow
97015ef775
Add a test case to check on the @argumentsfile syntax
2015-08-05 23:17:38 -07:00
James R. Barlow
2744dafb74
New test case: ensure metadata is preserved from input to output
2015-08-05 17:09:38 -07:00
James R. Barlow
7b268dbe1a
Remove duplication in test case
2015-08-05 16:57:04 -07:00
James R. Barlow
8fcbbcef94
Improve usage text
2015-08-05 16:56:53 -07:00
James R. Barlow
8f93f0a06e
Tidy docs
2015-08-05 16:56:30 -07:00
James R. Barlow
387142488c
Kill duplicate file
2015-07-31 01:57:16 -07:00
James R. Barlow
6887e232fc
Bug fix: exception from process timeout should be TimeoutExpired
2015-07-31 00:06:58 -07:00
James R. Barlow
6ac7ffd77b
Merge branch 'feature/drop-mupdf-poppler' into develop
2015-07-30 23:38:27 -07:00
James R. Barlow
b28faa582a
Automatically use all available cores unless told not to
2015-07-30 23:20:21 -07:00
James R. Barlow
454ee029c8
Run final ghostscript in multithreaded mode
...
This step is serialized so all cores are not busy at this stage.
2015-07-30 23:20:04 -07:00
James R. Barlow
a036de318e
Replace mupdf and poppler with qpdf
...
Drop two dependencies and replace them with one that does the job of
both. Smells like progress.
mupdf does PDF file repair and rendering
poppler does rendering and page splitting
qpdf does PDF file repair and page splitting
ghostscript does PDF file repair, rendering, and page splitting (sort of)
So we use qpdf. Ghostscript's page splitting is supposed is less
efficient because it reprints the page (PDF -> Postscript -> PDF) and
possibly loses quality. qpdf's library could be used to improve
performance.
This causes a slight performance regression:
py.test tests/test_main.py::test_maximum_options went from 187 seconds
up to 192. This is likely due to O(n) serialized invocations of qpdf
compared to a single serialized call to pdfseparate. Could improve on
this situation by using the example code in qpdf: pdf-split-pages.cc
or create marker files in split_pages() and then write a new @transform
function that would split pages on each CPU. Probably not worth it,
overall, unless this causes problems on files with hundreds of pages.
2015-07-30 04:16:35 -07:00
James R. Barlow
9918c4020e
Use img2pdf in test case because it does a better job
2015-07-30 03:35:56 -07:00
jbarlow83
3d6264e1b8
Fix formatting of 'motivation'
2015-07-28 17:58:26 -07:00
jbarlow83
1c25270503
Improve instructions for users that need sudo or venv
2015-07-28 17:55:56 -07:00
James R. Barlow
47e50f82c4
setup.py: allow mutool 1.7
2015-07-28 13:37:32 -07:00
James R. Barlow
27ecdfbba8
More fixes to error cases in setup.py
2015-07-28 13:05:23 -07:00
James R. Barlow
6901550065
Fix some installer issues
2015-07-28 12:41:24 -07:00
jbarlow83
6e6f918630
Actually link the release notes
2015-07-28 12:21:57 -07:00
jbarlow83
4633812246
Fix git clone command with one I tested ;)
2015-07-28 12:20:09 -07:00
jbarlow83
14bd1555aa
Update README with more detailed instructions
2015-07-28 12:15:37 -07:00