2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00

Fix exit code when an input other than the primary input generates warnings

This commit is contained in:
m-holger 2023-09-03 12:27:23 +01:00
parent 0046de0852
commit 94e6323206
3 changed files with 8 additions and 1 deletions

View File

@ -477,6 +477,12 @@ QPDFJob::createQPDF()
}
handleUnderOverlay(pdf);
handleTransformations(pdf);
for (auto& foreign: page_heap) {
if (foreign->anyWarnings()) {
m->warnings = true;
}
}
return pdf_sp;
}

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