diff options
author | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2023-12-16 17:50:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-16 17:50:17 +0100 |
commit | 290742b069756218cd9d2075ea18b9fa60fc56ca (patch) | |
tree | d672767c3866e4ea3ff13a38e0c6f033e8279d83 | |
parent | b0b6d9f21fe77fb7b46469529bf252f0dbcaa551 (diff) | |
parent | 9146f1f0fddccdcc874df3019ddd54c83b61faee (diff) | |
download | qpdf-290742b069756218cd9d2075ea18b9fa60fc56ca.tar.zst |
Merge pull request #1070 from m-holger/flate
Change default for SF_FlateLzwDecode::columns to 1
-rw-r--r-- | libqpdf/SF_FlateLzwDecode.cc | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/png-filters-1-column.pdf | bin | 0 -> 16827 bytes | |||
-rw-r--r-- | qpdf/qtest/qpdf/png-filters-no-columns-decoded.pdf | bin | 0 -> 26498 bytes | |||
-rw-r--r-- | qpdf/qtest/qpdf/png-filters-no-columns.pdf | bin | 0 -> 16827 bytes | |||
-rw-r--r-- | qpdf/qtest/specialized-filter.test | 16 |
5 files changed, 15 insertions, 3 deletions
diff --git a/libqpdf/SF_FlateLzwDecode.cc b/libqpdf/SF_FlateLzwDecode.cc index db663429..a291145f 100644 --- a/libqpdf/SF_FlateLzwDecode.cc +++ b/libqpdf/SF_FlateLzwDecode.cc @@ -11,7 +11,7 @@ SF_FlateLzwDecode::SF_FlateLzwDecode(bool lzw) : lzw(lzw), // Initialize values to their defaults as per the PDF spec predictor(1), - columns(0), + columns(1), colors(1), bits_per_component(8), early_code_change(true) diff --git a/qpdf/qtest/qpdf/png-filters-1-column.pdf b/qpdf/qtest/qpdf/png-filters-1-column.pdf Binary files differnew file mode 100644 index 00000000..5d9a8793 --- /dev/null +++ b/qpdf/qtest/qpdf/png-filters-1-column.pdf diff --git a/qpdf/qtest/qpdf/png-filters-no-columns-decoded.pdf b/qpdf/qtest/qpdf/png-filters-no-columns-decoded.pdf Binary files differnew file mode 100644 index 00000000..db597042 --- /dev/null +++ b/qpdf/qtest/qpdf/png-filters-no-columns-decoded.pdf diff --git a/qpdf/qtest/qpdf/png-filters-no-columns.pdf b/qpdf/qtest/qpdf/png-filters-no-columns.pdf Binary files differnew file mode 100644 index 00000000..83e9911a --- /dev/null +++ b/qpdf/qtest/qpdf/png-filters-no-columns.pdf diff --git a/qpdf/qtest/specialized-filter.test b/qpdf/qtest/specialized-filter.test index 284d5195..605dd7f2 100644 --- a/qpdf/qtest/specialized-filter.test +++ b/qpdf/qtest/specialized-filter.test @@ -16,7 +16,7 @@ cleanup(); my $td = new TestDriver('specialized-filter'); -my $n_tests = 3; +my $n_tests = 5; my $n_compare_pdfs = 1; # The PDF file was submitted on bug #83 on github. All the PNG filters @@ -39,6 +39,18 @@ $td->runtest("stream with tiff predictor", {$td->FILE => "tiff-predictor.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); - +# TC:SF_FlateLzwDecode PNG filter +# PDF:Table 8:Columns +# The test file is invalid as it does not actually use one column (as is implied by the missing +# key). However png-filters-1-column.pdf is the same file with /Columns explicitely set to 1, +# and displays the same as png-filters-no-columns.pdf and png-filters-no-columns-decoded.pdf. +$td->runtest("decode flate no /Columns", + {$td->COMMAND => "qpdf --static-id --compress-streams=n --decode-level=all" . + " png-filters-no-columns.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "png-filters-no-columns-decoded.pdf"}); cleanup(); $td->report(calc_ntests($n_tests, $n_compare_pdfs)); |