aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc8
-rw-r--r--qpdf/qtest/qpdf.test27
-rw-r--r--qpdf/qtest/qpdf/form-xobjects-some-resources1.out2
-rw-r--r--qpdf/qtest/qpdf/form-xobjects-some-resources2.out3
4 files changed, 13 insertions, 27 deletions
diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc
index 4460415b..77343b6f 100644
--- a/libqpdf/QPDFPageObjectHelper.cc
+++ b/libqpdf/QPDFPageObjectHelper.cc
@@ -785,10 +785,12 @@ QPDFPageObjectHelper::removeUnreferencedResourcesHelper(
if ((! local_unresolved.empty()) && resources.isDictionary())
{
+ // Don't issue a warning for this case. There are some cases
+ // of names that aren't XObject references, for example,
+ // /Artifact in tagged PDF. Until we are certain that we know
+ // the meaning of every name in a content stream, we don't
+ // want to give warnings because they will be false positives.
QTC::TC("qpdf", "QPDFPageObjectHelper unresolved names");
- ph.oh.warnIfPossible(
- "Unresolved names found while scanning content stream; "
- "not attempting to remove unreferenced objects from this object");
return false;
}
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index 7bfe21cd..a8a2357e 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -2018,7 +2018,7 @@ my @sp_cases = (
[1, 'broken data', '--pages broken-lzw.pdf --', 'split-out.pdf',
{$td->FILE => "broken-lzw.out", $td->EXIT_STATUS => 3}],
);
-$n_tests += 43;
+$n_tests += 42;
$n_compare_pdfs += 2;
for (@sp_cases)
{
@@ -2178,38 +2178,27 @@ foreach my $i (qw(1 2))
{$td->FILE => "shared-form-xobject-split-$i.pdf"});
}
-my @fo_resources = (['form-xobjects-no-resources', 0],
- ['form-xobjects-some-resources1', 3],
- ['form-xobjects-some-resources2', 3]);
+my @fo_resources = (['form-xobjects-no-resources', 1],
+ ['form-xobjects-some-resources1', 0],
+ ['form-xobjects-some-resources2', 0]);
foreach my $d (@fo_resources)
{
- my ($f, $status) = @$d;
- my $expout = ($status == 0 ?
- {$td->STRING => ""} :
- {$td->FILE => "$f.out"});
- $expout->{$td->EXIT_STATUS} = $status;
+ my ($f, $compare) = @$d;
$td->runtest("split $f",
{$td->COMMAND =>
"qpdf --empty --static-id --pages $f.pdf 1 --" .
" --remove-unreferenced-resources=yes a.pdf"},
- $expout, $td->NORMALIZE_NEWLINES);
+ {$td->STRING => "", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
$td->runtest("check output ($f)",
{$td->FILE => "a.pdf"},
{$td->FILE => "$f-out.pdf"});
- if ($status == 0)
+ if ($compare)
{
compare_pdfs("$f.pdf", "a.pdf");
}
}
-$td->runtest("no warn with pages warnings",
- {$td->COMMAND =>
- "qpdf --no-warn --empty --static-id".
- " --pages form-xobjects-some-resources1.pdf 1 --" .
- " --remove-unreferenced-resources=yes a.pdf"},
- {$td->STRING => "", $td->EXIT_STATUS => 3},
- $td->NORMALIZE_NEWLINES);
-
show_ntests();
# ----------
$td->notify("--- Keep Files Open ---");
diff --git a/qpdf/qtest/qpdf/form-xobjects-some-resources1.out b/qpdf/qtest/qpdf/form-xobjects-some-resources1.out
deleted file mode 100644
index 17d6c7f2..00000000
--- a/qpdf/qtest/qpdf/form-xobjects-some-resources1.out
+++ /dev/null
@@ -1,2 +0,0 @@
-WARNING: form-xobjects-some-resources1.pdf, stream object 8 0: Unresolved names found while scanning content stream; not attempting to remove unreferenced objects from this object
-qpdf: operation succeeded with warnings; resulting file may have some problems
diff --git a/qpdf/qtest/qpdf/form-xobjects-some-resources2.out b/qpdf/qtest/qpdf/form-xobjects-some-resources2.out
deleted file mode 100644
index a21ab495..00000000
--- a/qpdf/qtest/qpdf/form-xobjects-some-resources2.out
+++ /dev/null
@@ -1,3 +0,0 @@
-WARNING: form-xobjects-some-resources2.pdf, stream object 6 0: Unresolved names found while scanning content stream; not attempting to remove unreferenced objects from this object
-WARNING: form-xobjects-some-resources2.pdf, stream object 8 0: Unresolved names found while scanning content stream; not attempting to remove unreferenced objects from this object
-qpdf: operation succeeded with warnings; resulting file may have some problems