decoder: Cancel file loading on decoder drop
That will probably at least work for scrolling quickly through images. It will however usually not cancel an ongoing decoding process. Issue #155 Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/210>
This commit is contained in:
parent
6d7623b15a
commit
7c227f75a8
6 changed files with 56 additions and 48 deletions
|
|
@ -63,7 +63,8 @@ impl std::fmt::Debug for ImageMetadata {
|
|||
impl ImageMetadata {
|
||||
pub fn load(file: &gio::File) -> Self {
|
||||
log::debug!("Loading metadata for {}", file.uri());
|
||||
if let Ok(mut bufreader) = file.to_buf_read() {
|
||||
// TODO: make possible to cancel
|
||||
if let Ok(mut bufreader) = file.to_buf_read(&gio::Cancellable::new()) {
|
||||
let exifreader = exif::Reader::new();
|
||||
|
||||
if let Ok(exif) = exifreader.read_from_container(&mut bufreader) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue