2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Check for warnings in files used by --pages

This commit is contained in:
Jay Berkenbilt 2023-09-03 08:06:47 -04:00
parent dedf9a06df
commit fa3cdaf1b4
4 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2023-09-03 Jay Berkenbilt <ejb@ql.org>
* Bug fix: with --pages, if one of the external files had warnings
but the main file did not, the warning was previously not taken
into consideration when determining the exit status.
2023-09-02 Jay Berkenbilt <ejb@ql.org>
* Bug fix from M. Holger: allow fix-qdf to read from pipe. Fixes #1010.

View File

@ -2561,6 +2561,11 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea
}
}
}
for (auto const& p: page_spec_qpdfs) {
if (!p.second->getWarnings().empty()) {
m->warnings = true;
}
}
}
void

View File

@ -22,7 +22,7 @@ $td->runtest("handle page no with contents",
$td->NORMALIZE_NEWLINES);
$td->runtest("handle page with missing MediaBox",
{$td->COMMAND => "qpdf --static-id --empty --pages page-no-content.pdf -- out.pdf"},
{$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 0},
{$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 3},
$td->NORMALIZE_NEWLINES);
$td->runtest("check output",
{$td->FILE => "out.pdf"},

View File

@ -1 +1,2 @@
WARNING: page-no-content.pdf, object 4 0 at offset 288: kid 1 (from 0) MediaBox is undefined; setting to letter / ANSI A
qpdf: operation succeeded with warnings; resulting file may have some problems