2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-11 07:30:57 +00:00

Add test validating that images in nested XObjects are included in optimization

The sample file (nested-images.pdf) includes a pdf with an image that is
nested within an XObject within an XObject in the Resources dict of the
only page. These images were ignored in prior versions of qpdf.
This commit is contained in:
Connor Osborn 2023-03-13 16:38:49 -04:00
parent 8de2497a8f
commit f6b13fcc05
4 changed files with 22 additions and 0 deletions

View File

@ -33,6 +33,8 @@ my @image_opt = (
['large-inline-image', 'inline-images-keep-all', '--keep-inline-images'],
['unsupported-optimization', 'unsupported',
'--oi-min-width=0 --oi-min-height=0 --oi-min-area=0'],
['nested-images', 'nested-images',
'--oi-min-width=0 --oi-min-height=0 --oi-min-area=0']
);
my $n_tests = 2 * scalar(@image_opt);

Binary file not shown.

View File

@ -0,0 +1,18 @@
{
"version": 2,
"parameters": {
"decodelevel": "generalized"
},
"pages": [
{
"contents": [
"4 0 R"
],
"images": [],
"label": null,
"object": "3 0 R",
"outlines": [],
"pageposfrom1": 1
}
]
}

View File

@ -0,0 +1,2 @@
qpdf: image /X1 on page 1: optimizing image reduces size from 2628 to ...
qpdf: wrote file a.pdf