mirror of
https://codeberg.org/Fl1tzi/microdeck.git
synced 2024-05-19 19:20:20 +00:00
small note
This commit is contained in:
parent
db03650065
commit
282721ea92
|
@ -135,6 +135,8 @@ pub async fn load_image(path: PathBuf, resolution: (usize, usize)) -> Option<Dyn
|
||||||
return Some(image);
|
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 || {
|
let image = tokio::task::spawn_blocking(move || {
|
||||||
trace!("Resizing image");
|
trace!("Resizing image");
|
||||||
image = image.resize_exact(
|
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("microdeck");
|
||||||
path.push(image_cache_file_name(&image_hash, resolution));
|
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()?;
|
image.save(path).ok()?;
|
||||||
Some(image)
|
Some(image)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue