#[non_exhaustive]pub enum FilterError {
Corrupt {
filter: &'static str,
detail: String,
},
Truncated {
filter: &'static str,
},
OutputTooLarge,
BadParams(&'static str),
RaggedRows,
UnknownPngTag(u8),
UnsupportedFilter(String),
ImageCodec(String),
BadFilterEntry,
}Expand description
A filter-decode error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Corrupt
The compressed data is invalid (bad zlib header, corrupt deflate stream, checksum structurally unreadable, …).
Fields
Truncated
The stream ended before the filter’s own end-of-data — a truncated stream (§7.3.8.2 extent inconsistency).
OutputTooLarge
Decoded output crossed MAX_DECODED_LEN (pdfcer guard) — the
decode was aborted mid-stream.
BadParams(&'static str)
/DecodeParms carried an invalid parameter combination
(unknown Predictor value, zero Columns, bad
BitsPerComponent, …).
RaggedRows
Predicted data length is not a whole number of rows — wrong
parameters or truncation (filter__predictors.md row
arithmetic).
UnknownPngTag(u8)
A PNG row carried an algorithm tag outside 0–4 (RFC 2083 §6: an error).
UnsupportedFilter(String)
A standard filter pdfcer doesn’t implement yet (Pass 1 scope). The payload is the filter name as written.
ImageCodec(String)
The chain reaches an image codec, which decode_stream does
not handle by design (decision 005 R23). Decode it through
pdfcer_core::image_codec::decode_image, which has the &Document
and the image dictionary that these codecs require, and which
returns the codec-declared geometry and colour model that a
Vec<u8> cannot carry.
Deliberately distinct from FilterError::UnsupportedFilter:
that one means “pdfcer cannot decode this at all”, this one means
“you called the wrong entry point.” A caller that only wants
bytes (an xref stream, an object stream) genuinely cannot
proceed, so it is still an error there — but the operator-facing
message stays honest about which of the two situations it is.
BadFilterEntry
/Filter held something other than a name or array of names.
Trait Implementations§
Source§impl Clone for FilterError
impl Clone for FilterError
Source§impl Debug for FilterError
impl Debug for FilterError
Source§impl Display for FilterError
impl Display for FilterError
impl Eq for FilterError
Source§impl Error for FilterError
impl Error for FilterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()