2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00

In QPDFWriter::willFilterStream remember unfilterable streams

This commit is contained in:
m-holger 2024-08-02 19:23:17 +01:00
parent 2bb9e06d1e
commit 634d924986

View File

@ -1236,8 +1236,8 @@ QPDFWriter::writeTrailer(
bool bool
QPDFWriter::willFilterStream( QPDFWriter::willFilterStream(
QPDFObjectHandle stream, QPDFObjectHandle stream,
bool& compress_stream, bool& compress_stream, // out only
bool& is_metadata, bool& is_metadata, // out only
std::shared_ptr<Buffer>* stream_data) std::shared_ptr<Buffer>* stream_data)
{ {
compress_stream = false; compress_stream = false;
@ -1299,9 +1299,10 @@ QPDFWriter::willFilterStream(
throw std::runtime_error( throw std::runtime_error(
"error while getting stream data for " + stream.unparse() + ": " + e.what()); "error while getting stream data for " + stream.unparse() + ": " + e.what());
} }
if (filter && (!filtered)) { if (filter && !filtered) {
// Try again // Try again
filter = false; filter = false;
stream.setFilterOnWrite(false);
} else { } else {
break; break;
} }