Commit 306d734b368ac094ae37ba7382e56ec83ff30c70

Authored by m-holger
1 parent 65302426

Stop `--compress-streams=n` from automatically disabling preservation of existin…

…g encryption and update related tests.
libqpdf/QPDFWriter.cc
@@ -2268,7 +2268,7 @@ QPDFWriter::Members::doWriteSetup() @@ -2268,7 +2268,7 @@ QPDFWriter::Members::doWriteSetup()
2268 if (encryption) { 2268 if (encryption) {
2269 // Encryption has been explicitly set 2269 // Encryption has been explicitly set
2270 preserve_encryption = false; 2270 preserve_encryption = false;
2271 - } else if (normalize_content || !compress_streams || pclm || qdf_mode) { 2271 + } else if (normalize_content || pclm || qdf_mode) {
2272 // Encryption makes looking at contents pretty useless. If the user explicitly encrypted 2272 // Encryption makes looking at contents pretty useless. If the user explicitly encrypted
2273 // though, we still obey that. 2273 // though, we still obey that.
2274 preserve_encryption = false; 2274 preserve_encryption = false;
manual/release-notes.rst
@@ -59,6 +59,11 @@ more detail. @@ -59,6 +59,11 @@ more detail.
59 59
60 - Other changes 60 - Other changes
61 61
  62 + - Setting :qpdf:ref:`--compress-streams` to ``n`` or
  63 + ``QPDFWriter::setCompressStreams(false)`` no longer automatically
  64 + causes the outputfile to be decrypted. Set :qpdf:ref:`--decrypt` if this
  65 + is the intended behaviour.
  66 +
62 - There has been some refactoring of stream filtering. These are optimized 67 - There has been some refactoring of stream filtering. These are optimized
63 for the common case where no user provided stream filters are 68 for the common case where no user provided stream filters are
64 registered by calling ``QPDF::registerStreamFilter``. If you are 69 registered by calling ``QPDF::registerStreamFilter``. If you are
qpdf/qtest/content-preservation.test
@@ -30,8 +30,8 @@ my @flags = (["-qdf", # 1 @@ -30,8 +30,8 @@ my @flags = (["-qdf", # 1
30 "qdf not uncompressed"], 30 "qdf not uncompressed"],
31 ["-qdf --stream-data=preserve --normalize-content=n", # 4 31 ["-qdf --stream-data=preserve --normalize-content=n", # 4
32 "qdf not normalized or uncompressed"], 32 "qdf not normalized or uncompressed"],
33 - ["--stream-data=uncompress", # 5  
34 - "uncompresed"], 33 + ["--stream-data=uncompress --decrypt", # 5
  34 + "uncompresed (and decrpted)"],
35 ["--normalize-content=y", # 6 35 ["--normalize-content=y", # 6
36 "normalized"], 36 "normalized"],
37 ["--stream-data=uncompress --normalize-content=y", # 7 37 ["--stream-data=uncompress --normalize-content=y", # 7
qpdf/qtest/qpdf/job-json-input-file-password.json
1 { 1 {
  2 + "decrypt": "",
2 "inputFile": "20-pages.pdf", 3 "inputFile": "20-pages.pdf",
3 "password": "user", 4 "password": "user",
4 "outputFile": "a.pdf", 5 "outputFile": "a.pdf",