Enum image_webp::DecodingError

source ·
#[non_exhaustive]
pub enum DecodingError {
Show 28 variants IoError(Error), RiffSignatureInvalid([u8; 4]), WebpSignatureInvalid([u8; 4]), ChunkMissing, ChunkHeaderInvalid([u8; 4]), ReservedBitSet, InvalidCompressionMethod, AlphaChunkSizeMismatch, ImageTooLarge, FrameOutsideImage, LosslessSignatureInvalid(u8), VersionNumberInvalid(u8), InvalidColorCacheBits(u8), HuffmanError, BitStreamError, TransformError, Vp8MagicInvalid([u8; 3]), NotEnoughInitData, ColorSpaceInvalid(u8), LumaPredictionModeInvalid(i8), IntraPredictionModeInvalid(i8), ChromaPredictionModeInvalid(i8), InconsistentImageSizes, UnsupportedFeature(String), InvalidParameter(String), MemoryLimitExceeded, InvalidChunkSize, NoMoreFrames,
}
Expand description

Errors that can occur when attempting to decode a WebP image

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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

§

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§

source§

impl Debug for DecodingError

source§

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

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

impl Display for DecodingError

source§

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

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

impl Error for DecodingError

source§

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

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for DecodingError

source§

fn from(err: Error) -> DecodingError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.