mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Prepare for user saving of anime sequences
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
use gif::DecodingError;
|
||||
use png_pong::decode::Error as PngError;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -7,6 +8,7 @@ pub enum AnimeError {
|
||||
NoFrames,
|
||||
Io(std::io::Error),
|
||||
Png(PngError),
|
||||
Gif(DecodingError),
|
||||
Format
|
||||
}
|
||||
|
||||
@@ -17,6 +19,7 @@ impl fmt::Display for AnimeError {
|
||||
AnimeError::NoFrames => write!(f, "No frames in PNG"),
|
||||
AnimeError::Io(e) => write!(f, "Could not open: {}", e),
|
||||
AnimeError::Png(e) => write!(f, "PNG error: {}", e),
|
||||
AnimeError::Gif(e) => write!(f, "GIF error: {}", e),
|
||||
AnimeError::Format => write!(f, "PNG file is not 8bit greyscale"),
|
||||
}
|
||||
}
|
||||
@@ -34,4 +37,10 @@ impl From<PngError> for AnimeError {
|
||||
fn from(err: PngError) -> Self {
|
||||
AnimeError::Png(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DecodingError> for AnimeError {
|
||||
fn from(err: DecodingError) -> Self {
|
||||
AnimeError::Gif(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user