pub enum AsepriteError {
Io(Error),
InvalidMagic,
UnsupportedColorDepth(u16),
FrameOutOfBounds(usize),
PixelSizeMismatch {
expected: usize,
actual: usize,
},
InvalidFrameRange,
MissingPalette,
LinkedCelNotFound {
layer: usize,
source_frame: usize,
},
InvalidChunkSize,
UnsupportedChunkType(u16),
FormatLimitExceeded {
field: &'static str,
value: usize,
max: usize,
},
}Expand description
Errors that can occur when reading or writing Aseprite files.
Variants§
Io(Error)
An I/O error occurred during reading or writing.
InvalidMagic
The file does not start with the Aseprite magic number 0xA5E0.
UnsupportedColorDepth(u16)
The file uses a color depth that is not 8, 16, or 32 bits.
FrameOutOfBounds(usize)
A frame index is out of bounds.
PixelSizeMismatch
Pixel data buffer size does not match the expected size for the given dimensions and color mode.
InvalidFrameRange
A tag’s frame range extends beyond the number of frames in the file.
MissingPalette
Indexed color mode requires a palette, but none was set.
LinkedCelNotFound
A linked cel references a source frame that does not contain a cel on the same layer.
InvalidChunkSize
A chunk’s declared size is invalid.
UnsupportedChunkType(u16)
A chunk or property type ID is not recognized.
FormatLimitExceeded
A value exceeds the format’s limit (e.g., more than 256 palette entries).
Trait Implementations§
Source§impl Debug for AsepriteError
impl Debug for AsepriteError
Source§impl Display for AsepriteError
impl Display for AsepriteError
Source§impl Error for AsepriteError
impl Error for AsepriteError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()