Enum DecodingError

#[non_exhaustive]
pub enum DecodingError

Errors that can occur when attempting to decode a WebP image

Variants

IoError(Error)

An IO error occurred while reading the file

RiffSignatureInvalid([u8; 4])

RIFF's "RIFF" signature not found or invalid

WebpSignatureInvalid([u8; 4])

WebP's "WEBP" signature not found or invalid

ChunkMissing

An expected chunk was missing

ChunkHeaderInvalid([u8; 4])

Chunk Header was incorrect or invalid in its usage

ReservedBitSet

Some bits were invalid

InvalidAlphaPreprocessing

The ALPH chunk preprocessing info flag was invalid

InvalidCompressionMethod

Invalid compression method

AlphaChunkSizeMismatch

Alpha chunk doesn't match the frame's size

ImageTooLarge

Image is too large, either for the platform's pointer size or generally

FrameOutsideImage

Frame would go out of the canvas

LosslessSignatureInvalid(u8)

Signature of 0x2f not found

VersionNumberInvalid(u8)

Version Number was not zero

InvalidColorCacheBits(u8)

Invalid color cache bits

HuffmanError

An invalid Huffman code was encountered

BitStreamError

The bitstream was somehow corrupt

TransformError

The transforms specified were invalid

Vp8MagicInvalid([u8; 3])

VP8's [0x9D, 0x01, 0x2A] magic not found or invalid

NotEnoughInitData

VP8 Decoder initialisation wasn't provided with enough data

ColorSpaceInvalid(u8)

At time of writing, only the YUV colour-space encoded as 0 is specified

LumaPredictionModeInvalid(i8)

LUMA prediction mode was not recognised

IntraPredictionModeInvalid(i8)

Intra-prediction mode was not recognised

ChromaPredictionModeInvalid(i8)

Chroma prediction mode was not recognised

InconsistentImageSizes

Inconsistent image sizes

UnsupportedFeature(String)

The file may be valid, but this crate doesn't support decoding it.

InvalidParameter(String)

Invalid function call or parameter

MemoryLimitExceeded

Memory limit exceeded

InvalidChunkSize

Invalid chunk size

NoMoreFrames

No more frames in image

Trait Implementations

impl Debug for DecodingError

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

impl Display for DecodingError

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

impl Error for DecodingError

fn source(&self) -> Option<&dyn Error + 'static>

impl From<Error> for DecodingError

fn from(err: Error) -> DecodingError

Auto Trait Implementations

impl !RefUnwindSafe for DecodingError

impl !UnwindSafe for DecodingError

impl Freeze for DecodingError

impl Send for DecodingError

impl Sync for DecodingError

impl Unpin for DecodingError

impl UnsafeUnpin for DecodingError

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for DecodingError where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for DecodingError where T: ?Sized,

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

impl<T> From<T> for DecodingError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for DecodingError where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for DecodingError where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for DecodingError where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for DecodingError where U: TryFrom<T>,

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