pub enum EncodeError {
InvalidDimensions {
width: u32,
height: u32,
},
UnsupportedFormat {
color: ColorType,
bit_depth: BitDepth,
},
DataLengthMismatch {
expected: usize,
actual: usize,
},
ImageTooLarge,
InvalidTextKeyword(String),
InvalidTextValue {
keyword: String,
},
InvalidDpi(f64),
NoFrames,
FrameMismatch {
index: usize,
},
OutOfMemory(OutOfMemory),
}Expand description
An error preventing an image from being encoded.
Variants§
InvalidDimensions
Width or height is zero or above 2^31 − 1.
UnsupportedFormat
The encoder does not write this colour type / bit depth combination.
DataLengthMismatch
The pixel data does not have the size the dimensions imply.
ImageTooLarge
The image is too large to address in memory.
InvalidTextKeyword(String)
A text keyword is empty, longer than 79 bytes, not printable Latin-1, or has leading, trailing or consecutive spaces.
InvalidTextValue
A text value contains a NUL character or does not fit in a chunk.
InvalidDpi(f64)
A resolution is not a finite positive number of dots per inch that
fits the pHYs chunk.
NoFrames
An animated PNG needs at least one frame.
FrameMismatch
An animation frame differs in size or format from the first one.
OutOfMemory(OutOfMemory)
The memory for the encoded image cannot be allocated.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<OutOfMemory> for EncodeError
impl From<OutOfMemory> for EncodeError
Source§fn from(err: OutOfMemory) -> Self
fn from(err: OutOfMemory) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EncodeError
impl PartialEq for EncodeError
impl StructuralPartialEq for EncodeError
Auto Trait Implementations§
impl Forget for EncodeError
impl Freeze for EncodeError
impl Move for EncodeError
impl RefUnwindSafe for EncodeError
impl Send for EncodeError
impl Sync for EncodeError
impl Unpin for EncodeError
impl UnsafeUnpin for EncodeError
impl UnwindSafe for EncodeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more