diff --git a/tests/resources/README.rst b/tests/resources/README.rst index 735d7cf3..b790d1cd 100644 --- a/tests/resources/README.rst +++ b/tests/resources/README.rst @@ -31,16 +31,30 @@ Files generated for this project The following test resources were crafted specifically for this project, and can be used under the terms of the license in LICENSE.rst. -- aspect.pdf (a page with an image with 200 x 100 DPI resolution) -- blank.pdf (a blank PDF page) -- cmyk.pdf (a CMYK image created in Photoshop) -- enormous.pdf (a very lage page) -- francais.pdf (a page containing French accented characters) -- hugemono.pdf (large monochrome JBIG2 page with pixel dimensions of 35000x35000) -- invalid.pdf (a PDF file header followed by EOF marker) -- masks.pdf (a file containing explicit masks and stencil masks; printout of `"Linux" (German Wikipedia article)`_ (Creative Commons Attribution-ShareAlike) scanned on a HP Officejet 8620 scanner, contributed by Github user @supergrobi) -- missing_docinfo.pdf (PDF file with no /DocumentInfo section) - ++---------------------+-----------------------+---------------------------------------------------------+ +| File | Contributor | Purpose | ++---------------------+-----------------------+---------------------------------------------------------+ +| aspect.pdf | @jbarlow83 | test image with 200 x 100 DPI resolution | ++---------------------+-----------------------+---------------------------------------------------------+ +| blank.pdf | @jbarlow83 | blank PDF | ++---------------------+-----------------------+---------------------------------------------------------+ +| cmyk.pdf | @jbarlow83 | a CMYK image created in Photoshop | ++---------------------+-----------------------+---------------------------------------------------------+ +| enormous.pdf | @jbarlow83 | very large PDF page | ++---------------------+-----------------------+---------------------------------------------------------+ +| francais.pdf | @jbarlow83 | a page containing French accents (diacritics) | ++---------------------+-----------------------+---------------------------------------------------------+ +| hugemono.pdf | @jbarlow83 | large monochrome 35000x35000 image in JBIG2 encoding | ++---------------------+-----------------------+---------------------------------------------------------+ +| invalid.pdf | @jbarlow83 | a PDF file header followed by EOF marker | ++---------------------+-----------------------+---------------------------------------------------------+ +| masks.pdf | @supergrobi | file containing stencil masks; printout of a German | +| | | Wikipedia article (Creative Commons BY-SA) | ++---------------------+-----------------------+---------------------------------------------------------+ +| milk.pdf | @lowesjam | linearized PDF containing some indirect objects | ++---------------------+-----------------------+---------------------------------------------------------+ +| missing_docinfo.pdf | @jbarlow83 | PDF file with no /DocumentInfo section | ++---------------------+-----------------------+---------------------------------------------------------+ Assemblies ========== diff --git a/tests/resources/milk.pdf b/tests/resources/milk.pdf new file mode 100644 index 00000000..9f41e408 Binary files /dev/null and b/tests/resources/milk.pdf differ diff --git a/tests/test_main.py b/tests/test_main.py index d5d8de6e..743ff83b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -633,3 +633,6 @@ def test_stdin(spoof_tesseract_noop): def test_masks(spoof_tesseract_noop): check_ocrmypdf('masks.pdf', 'test_masks.pdf', env=spoof_tesseract_noop) + +def test_linearized_pdf_and_indirect_object(spoof_tesseract_noop): + check_ocrmypdf('milk.pdf', 'test_milk.pdf', env=spoof_tesseract_noop)