#[non_exhaustive]pub enum ImageCodecError {
Filter(FilterError),
Unsupported {
codec: Codec,
},
FeatureUnsupported {
feature: &'static str,
},
Corrupt {
codec: Codec,
detail: String,
},
TooLarge,
AllocationFailed {
bytes: u64,
},
NotAllowedInline {
codec: Codec,
},
BrotliNotAllowedInline,
CodecNotTerminal,
}Expand description
Why an image stream could not be turned into samples.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Filter(FilterError)
A byte-stream filter in the chain’s prefix failed.
Unsupported
The codec itself is recognized but not implemented in this build. Should be zero once Pass 2.3 lands; the variant is kept afterwards so a regression stays visible.
FeatureUnsupported
A specific codec sub-feature is unimplemented (rule R27).
feature is a stable diagnostic key such as "DCT/arithmetic"
or "DCT/12-bit", suitable for counting by name.
Corrupt
The codestream is malformed or truncated.
Fields
TooLarge
The codestream’s declared geometry crosses a pdfcer ceiling
(MAX_IMAGE_PIXELS, MAX_IMAGE_DIMENSION,
MAX_IMAGE_SAMPLE_BYTES).
AllocationFailed
The allocator refused a buffer the image needed. The image is within pdfcer’s ceilings; the machine lacks the memory (decision 226). Never an abort, because on wasm32 an abort traps the module.
NotAllowedInline
The codec is forbidden inside an inline image (§7.4.7, §8.9.7).
BrotliNotAllowedInline
/BrotliDecode appeared in an inline image’s filter chain, which
EXTN-BROTLI-1 §5.2 forbids outright.
Distinct from ImageCodecError::NotAllowedInline deliberately: that
one names a terminal codec the inline form does not admit, while
this is a byte-stream filter that is legal everywhere else a
stream is legal. Collapsing the two would report “codec not allowed
inline” about something that is not a codec, and an operator chasing
that message would look in the wrong half of the file.
CodecNotTerminal
Two or more terminal codecs in one /Filter chain, or a codec
followed by further filters. Neither is meaningful: a codec
consumes a codestream and produces samples, so nothing can be
chained after it.
Trait Implementations§
Source§impl Clone for ImageCodecError
impl Clone for ImageCodecError
Source§impl Debug for ImageCodecError
impl Debug for ImageCodecError
Source§impl Display for ImageCodecError
impl Display for ImageCodecError
impl Eq for ImageCodecError
Source§impl Error for ImageCodecError
impl Error for ImageCodecError
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()