mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Return error if a pixel-gif is larger than the anime-display dimensions
This commit is contained in:
@@ -20,6 +20,8 @@ pub enum AnimeError {
|
||||
UnsupportedDevice,
|
||||
InvalidBrightness(f32),
|
||||
DataBufferLength,
|
||||
PixelGifWidth(usize),
|
||||
PixelGifHeight(usize),
|
||||
}
|
||||
|
||||
impl fmt::Display for AnimeError {
|
||||
@@ -49,6 +51,13 @@ impl fmt::Display for AnimeError {
|
||||
"Image brightness must be between 0.0 and 1.0 (inclusive), was {}",
|
||||
bright
|
||||
),
|
||||
AnimeError::PixelGifWidth(n) => {
|
||||
write!(f, "The gif used for pixel-perfect gif is is wider than {n}")
|
||||
}
|
||||
AnimeError::PixelGifHeight(n) => write!(
|
||||
f,
|
||||
"The gif used for pixel-perfect gif is is taller than {n}"
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user