Add test to confirm we can find formx optimizable images

This commit is contained in:
James R. Barlow
2023-05-23 00:33:54 -07:00
parent 1bc09045a5
commit 070c9772ce
+8
View File
@@ -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