Skip to content

Commit

Permalink
Add test to confirm we can find formx optimizable images
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed May 23, 2023
1 parent 1bc0904 commit 070c977
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,11 @@ def test_group3(resources, outdir):
assert (
opt.extract_image_filter(pdf, outdir, im, im.objgen[0]) is None
), "Group 3 should be disallowed"


def test_find_formx(resources, outdir):
with pikepdf.open(resources / 'formxobject.pdf') as pdf:
working, pagenos = opt._find_image_xrefs(pdf)
assert len(working) == 1
xref = next(iter(working))
assert pagenos[xref] == 0

0 comments on commit 070c977

Please sign in to comment.