Merge pull request #1030 from m-holger/exit

Fix exit code when an input other than the primary input generates wa…
This commit is contained in:
Jay Berkenbilt 2023-09-03 08:37:14 -04:00 committed by GitHub
commit fec75b44b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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