diff options
author | Jay Berkenbilt <ejb@ql.org> | 2017-09-12 21:48:08 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2017-09-12 22:03:48 +0200 |
commit | d31a7b76e7fa6fc6fa31d94394b59f990920d09c (patch) | |
tree | ae2c107d061eddbad986f059230dda08f296abf6 /include | |
parent | eaacf94005ff8189e215447ffeadc341eca6c019 (diff) | |
download | qpdf-d31a7b76e7fa6fc6fa31d94394b59f990920d09c.tar.zst |
Improve message for stream decoding error
Tweak the message so that we inform the user that we are mitigating
data loss.
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDF.hh | 9 | ||||
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 8b03eed7..ddd82b4d 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -554,11 +554,13 @@ class QPDF static bool pipeStreamData(QPDF* qpdf, int objid, int generation, qpdf_offset_t offset, size_t length, QPDFObjectHandle dict, - Pipeline* pipeline, bool suppress_warnings) + Pipeline* pipeline, + bool suppress_warnings, + bool will_retry) { return qpdf->pipeStreamData( objid, generation, offset, length, dict, pipeline, - suppress_warnings); + suppress_warnings, will_retry); } }; friend class Pipe; @@ -688,7 +690,8 @@ class QPDF qpdf_offset_t offset, size_t length, QPDFObjectHandle dict, Pipeline* pipeline, - bool suppress_warnings); + bool suppress_warnings, + bool will_retry); // For QPDFWriter: diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 936ccc5d..79d83851 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -420,12 +420,21 @@ class QPDFObjectHandle // configured filters. QPDFWriter handles this by attempting to // get the stream data without filtering, but callers should // consider a false return value when decode_level is not - // qpdf_dl_none to be a potential loss of data. + // qpdf_dl_none to be a potential loss of data. If you intend to + // retry in that case, pass true as the value of will_retry. This + // changes the warning issued by the library to indicate that the + // operation will be retried without filtering to avoid data loss. QPDF_DLL bool pipeStreamData(Pipeline*, unsigned long encode_flags, qpdf_stream_decode_level_e decode_level, bool suppress_warnings = false); + QPDF_DLL + bool pipeStreamData(Pipeline*, + unsigned long encode_flags, + qpdf_stream_decode_level_e decode_level, + bool suppress_warnings, + bool will_retry); // Legacy pipeStreamData. This maps to the the flags-based // pipeStreamData as follows: |