Commit 57ad405b8da9397320bfcb9d76a63e44266afa49
1 parent
f32066d6
Avoid unnecessary re-compression in QPDFJob::doCheck
Showing
1 changed file
with
5 additions
and
0 deletions
libqpdf/QPDFJob.cc
| ... | ... | @@ -793,6 +793,11 @@ QPDFJob::doCheck(QPDF& pdf) |
| 793 | 793 | Pl_Discard discard; |
| 794 | 794 | w.setOutputPipeline(&discard); |
| 795 | 795 | w.setDecodeLevel(qpdf_dl_all); |
| 796 | + // Disable compression of streams, since we only need to confirm we can decode them. This | |
| 797 | + // avoids JPEG DCT -> Flate recompression of all images. | |
| 798 | + w.setCompressStreams(false); | |
| 799 | + // Also disable recompression of Flate streams since are only checking. | |
| 800 | + w.setRecompressFlate(false); | |
| 796 | 801 | w.write(); |
| 797 | 802 | |
| 798 | 803 | // Parse all content streams | ... | ... |