James R. Barlow
7eca8508fd
Implement new preprocessing feature, background removal
2016-10-14 17:23:34 -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
013c5a369f
Replace redacted file with an OCR-able file
2016-10-07 12:45:22 -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
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
9ca29c787b
Update description of masks.pdf to reflect what it actually tests
2016-09-01 21:21:14 -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
bf89e38c69
Add milk.pdf test case
2016-08-31 11:42:21 -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
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
2025a096c3
Test case for stdin streaming
2016-08-25 14:46:54 -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
e70387b1af
Add a simple test for image to PDF
2016-08-03 03:35:30 -07:00
James R. Barlow
91d715ac93
Add test cases for --output-type
2016-08-03 02:47:18 -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
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
jbarlow83 and GitHub
1bacf35a2c
Update license information for encrypted_algo4.pdf
2016-06-24 14:25:15 -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
ff092c8629
Fix race condition between these tests when run in parallel
2016-04-28 00:39:15 -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
322085933b
unpaper: fix check for missing and old versions, add test case
2016-03-10 15:37:09 -08:00
James R. Barlow
f3e06b2dbd
Add bookmarks to file for more testing
2016-02-29 00:05:07 -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
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
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
ac71c3be63
4.0.2rc1 - release notes, add missing file caught by Travis
2016-02-20 03:36:37 -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
812fd745b6
Remove redundant line from resources
2016-02-16 14:29:56 -08:00
James R. Barlow
ef0aab060a
Make debug output more verbose on failure
2016-02-16 05:17:18 -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
6510bcad19
DPI information not transferred automatically from PNG to JPEG
2016-02-09 02:18:54 -08:00