Commit c6a3d83fb5958684436c8b607509079da22193f3

Authored by Jay Berkenbilt
1 parent fa3cdaf1

Revert "Check for warnings in files used by --pages"

m-holger's fix is better

This reverts commit fa3cdaf1b46dcbb583393f93a02f89207ba21a88.
ChangeLog
1 -2023-09-03 Jay Berkenbilt <ejb@ql.org>  
2 -  
3 - * Bug fix: with --pages, if one of the external files had warnings  
4 - but the main file did not, the warning was previously not taken  
5 - into consideration when determining the exit status.  
6 -  
7 2023-09-02 Jay Berkenbilt <ejb@ql.org> 1 2023-09-02 Jay Berkenbilt <ejb@ql.org>
8 2
9 * Bug fix from M. Holger: allow fix-qdf to read from pipe. Fixes #1010. 3 * Bug fix from M. Holger: allow fix-qdf to read from pipe. Fixes #1010.
libqpdf/QPDFJob.cc
@@ -2561,11 +2561,6 @@ QPDFJob::handlePageSpecs(QPDF&amp; pdf, std::vector&lt;std::unique_ptr&lt;QPDF&gt;&gt;&amp; page_hea @@ -2561,11 +2561,6 @@ QPDFJob::handlePageSpecs(QPDF&amp; pdf, std::vector&lt;std::unique_ptr&lt;QPDF&gt;&gt;&amp; page_hea
2561 } 2561 }
2562 } 2562 }
2563 } 2563 }
2564 - for (auto const& p: page_spec_qpdfs) {  
2565 - if (!p.second->getWarnings().empty()) {  
2566 - m->warnings = true;  
2567 - }  
2568 - }  
2569 } 2564 }
2570 2565
2571 void 2566 void
qpdf/qtest/page-errors.test
@@ -22,7 +22,7 @@ $td-&gt;runtest(&quot;handle page no with contents&quot;, @@ -22,7 +22,7 @@ $td-&gt;runtest(&quot;handle page no with contents&quot;,
22 $td->NORMALIZE_NEWLINES); 22 $td->NORMALIZE_NEWLINES);
23 $td->runtest("handle page with missing MediaBox", 23 $td->runtest("handle page with missing MediaBox",
24 {$td->COMMAND => "qpdf --static-id --empty --pages page-no-content.pdf -- out.pdf"}, 24 {$td->COMMAND => "qpdf --static-id --empty --pages page-no-content.pdf -- out.pdf"},
25 - {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 3}, 25 + {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 0},
26 $td->NORMALIZE_NEWLINES); 26 $td->NORMALIZE_NEWLINES);
27 $td->runtest("check output", 27 $td->runtest("check output",
28 {$td->FILE => "out.pdf"}, 28 {$td->FILE => "out.pdf"},
qpdf/qtest/qpdf/page-missing-mediabox.out
1 WARNING: page-no-content.pdf, object 4 0 at offset 288: kid 1 (from 0) MediaBox is undefined; setting to letter / ANSI A 1 WARNING: page-no-content.pdf, object 4 0 at offset 288: kid 1 (from 0) MediaBox is undefined; setting to letter / ANSI A
2 -qpdf: operation succeeded with warnings; resulting file may have some problems