small note

This commit is contained in:
Fl1tzi 2024-02-26 01:28:19 +01:00
parent db03650065
commit 282721ea92
No known key found for this signature in database
GPG key ID: 06B333727810C686

View file

@ -135,6 +135,8 @@ pub async fn load_image(path: PathBuf, resolution: (usize, usize)) -> Option<Dyn
return Some(image);
}
// TODO prevent multiple buttons from resizing the same image at the same time (performance
// improvement)
let image = tokio::task::spawn_blocking(move || {
trace!("Resizing image");
image = image.resize_exact(
@ -149,9 +151,7 @@ pub async fn load_image(path: PathBuf, resolution: (usize, usize)) -> Option<Dyn
};
path.push("microdeck");
path.push(image_cache_file_name(&image_hash, resolution));
// let mut file = File::create(path);
// file.write_all(image.as_bytes());
// currently just ignore if saving is not possible
image.save(path).ok()?;
Some(image)
})