Fix image errors
* Firstly only log one error per image load, not per frame * Secondly use an Icon not an image for rendering Icons
This commit is contained in:
parent
ceb20dea96
commit
6bfe6fa0e1
3 changed files with 17 additions and 10 deletions
|
@ -2,7 +2,7 @@ use crate::{ImageData, ImageId, SharedString};
|
|||
use collections::HashMap;
|
||||
use futures::{
|
||||
future::{BoxFuture, Shared},
|
||||
AsyncReadExt, FutureExt,
|
||||
AsyncReadExt, FutureExt, TryFutureExt,
|
||||
};
|
||||
use image::ImageError;
|
||||
use parking_lot::Mutex;
|
||||
|
@ -88,6 +88,14 @@ impl ImageCache {
|
|||
Ok(Arc::new(ImageData::new(image)))
|
||||
}
|
||||
}
|
||||
.map_err({
|
||||
let uri = uri.clone();
|
||||
|
||||
move |error| {
|
||||
log::log!(log::Level::Error, "{:?} {:?}", &uri, &error);
|
||||
error
|
||||
}
|
||||
})
|
||||
.boxed()
|
||||
.shared();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue