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

§crc_val: u32

Stored CRC32 value

§crc_sum: u32

Calculated CRC32 sum

§chunk: ChunkType

The chunk type that has the CRC mismatch.

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

Fields

4.3., Must be first.

§

AfterIdat

Fields

4.3., some chunks must be before IDAT.

§

AfterPlte

Fields

4.3., some chunks must be before PLTE.

§

OutsidePlteIdat

Fields

4.3., some chunks must be between PLTE and IDAT.

§

DuplicateChunk

Fields

4.3., some chunks must be unique.

§

ApngOrder

Fields

§present: u32

The sequence number in the chunk.

§expected: u32

The one that should have been present.

Specifically for fdat there is an embedded sequence number for chunks.

§

ShortPalette

Fields

§expected: usize
§len: usize

The palette did not even contain a single pixel data.

§

PaletteRequired

A palletized image did not have a palette.

§

InvalidColorBitDepth

Fields

§color_type: ColorType
§bit_depth: BitDepth

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

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

Trait Implementations§

source§

impl Debug for FormatErrorInner

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<FormatErrorInner> for FormatError

source§

fn from(inner: FormatErrorInner) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.