Enum png::decoder::stream::FormatErrorInner
source · pub(crate) enum FormatErrorInner {
Show 32 variants
CrcMismatch {
crc_val: u32,
crc_sum: u32,
chunk: ChunkType,
},
InvalidSignature,
UnexpectedEof,
UnexpectedEndOfChunk,
MissingIhdr,
MissingFctl,
MissingImageData,
ChunkBeforeIhdr {
kind: ChunkType,
},
AfterIdat {
kind: ChunkType,
},
AfterPlte {
kind: ChunkType,
},
OutsidePlteIdat {
kind: ChunkType,
},
DuplicateChunk {
kind: ChunkType,
},
ApngOrder {
present: u32,
expected: u32,
},
ShortPalette {
expected: usize,
len: usize,
},
PaletteRequired,
InvalidColorBitDepth {
color_type: ColorType,
bit_depth: BitDepth,
},
ColorWithBadTrns(ColorType),
InvalidDimensions,
InvalidBitDepth(u8),
InvalidColorType(u8),
InvalidDisposeOp(u8),
InvalidBlendOp(u8),
InvalidUnit(u8),
InvalidSrgbRenderingIntent(u8),
UnknownCompressionMethod(u8),
UnknownFilterMethod(u8),
UnknownInterlaceMethod(u8),
BadSubFrameBounds {},
CorruptFlateStream {
err: DecompressionError,
},
NoMoreImageData,
BadTextEncoding(TextDecodingError),
FdatShorterThanFourBytes,
}
Variants§
CrcMismatch
Fields
Bad framing.
InvalidSignature
Not a PNG, the magic signature is missing.
UnexpectedEof
End of file, within a chunk event.
UnexpectedEndOfChunk
End of file, while expecting more image data.
MissingIhdr
Ihdr must occur.
MissingFctl
Fctl must occur if an animated chunk occurs.
MissingImageData
Image data that was indicated in IHDR or acTL is missing.
ChunkBeforeIhdr
4.3., Must be first.
AfterIdat
4.3., some chunks must be before IDAT.
AfterPlte
4.3., some chunks must be before PLTE.
OutsidePlteIdat
4.3., some chunks must be between PLTE and IDAT.
DuplicateChunk
4.3., some chunks must be unique.
ApngOrder
Fields
Specifically for fdat there is an embedded sequence number for chunks.
ShortPalette
The palette did not even contain a single pixel data.
PaletteRequired
A palletized image did not have a palette.
InvalidColorBitDepth
The color-depth combination is not valid according to Table 11.1.
ColorWithBadTrns(ColorType)
InvalidDimensions
The image width or height is zero.
InvalidBitDepth(u8)
InvalidColorType(u8)
InvalidDisposeOp(u8)
InvalidBlendOp(u8)
InvalidUnit(u8)
InvalidSrgbRenderingIntent(u8)
The rendering intent of the sRGB chunk is invalid.
UnknownCompressionMethod(u8)
UnknownFilterMethod(u8)
UnknownInterlaceMethod(u8)
BadSubFrameBounds
Fields
The subframe is not in bounds of the image. TODO: fields with relevant data.
CorruptFlateStream
Fields
err: DecompressionError
The compression of the data stream was faulty.
NoMoreImageData
The image data chunk was too short for the expected pixel count.
BadTextEncoding(TextDecodingError)
Bad text encoding
FdatShorterThanFourBytes
fdAT shorter than 4 bytes