diff options
author | Jay Berkenbilt <ejb@ql.org> | 2017-08-19 15:18:14 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2017-08-21 23:44:22 +0200 |
commit | 9744414c66e3f85700ebc8b32d90f45ff97221bd (patch) | |
tree | 47abed5c4105fe3f0089ab9afdf1d053d806b39d /libqpdf/QPDF.cc | |
parent | ae90d2c485318beb8b4b938d09ffaf5c6f0a5e21 (diff) | |
download | qpdf-9744414c66e3f85700ebc8b32d90f45ff97221bd.tar.zst |
Enable finer grained control of stream decoding
This commit adds several API methods that enable control over which
types of filters QPDF will attempt to decode. It also adds support for
/RunLengthDecode and /DCTDecode filters for both encoding and
decoding.
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r-- | libqpdf/QPDF.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index d1360b14..9c79fc3a 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -45,7 +45,7 @@ QPDF::CopiedStreamDataProvider::provideStreamData( { QPDFObjectHandle foreign_stream = this->foreign_streams[QPDFObjGen(objid, generation)]; - foreign_stream.pipeStreamData(pipeline, false, false, false); + foreign_stream.pipeStreamData(pipeline, 0, qpdf_dl_none); } void @@ -2377,6 +2377,7 @@ QPDF::pipeStreamData(int objid, int generation, length -= len; pipeline->write(QUtil::unsigned_char_pointer(buf), len); } + pipeline->finish(); success = true; } catch (QPDFExc& e) @@ -2398,13 +2399,16 @@ QPDF::pipeStreamData(int objid, int generation, QUtil::int_to_string(generation) + ": " + e.what())); } } - try - { - pipeline->finish(); - } - catch (std::exception&) + if (! success) { - // ignore + try + { + pipeline->finish(); + } + catch (std::exception&) + { + // ignore + } } return success; } |