mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Rename and recreate the default Anime config if cache setup fails
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
use std::path::Path;
|
||||
use std::time::Duration;
|
||||
|
||||
use log::error;
|
||||
|
||||
use crate::data::AnimeDataBuffer;
|
||||
use crate::error::{AnimeError, Result};
|
||||
use crate::AnimeType;
|
||||
@@ -49,7 +51,10 @@ impl AnimeDiagonal {
|
||||
bright: f32,
|
||||
anime_type: AnimeType,
|
||||
) -> Result<Self> {
|
||||
let data = std::fs::read(path)?;
|
||||
let data = std::fs::read(path).map_err(|e| {
|
||||
error!("Could not open {path:?}: {e:?}");
|
||||
e
|
||||
})?;
|
||||
let data = std::io::Cursor::new(data);
|
||||
let decoder = png_pong::Decoder::new(data)?.into_steps();
|
||||
let png_pong::Step { raster, delay: _ } = decoder.last().ok_or(AnimeError::NoFrames)??;
|
||||
|
||||
Reference in New Issue
Block a user