diff --git a/crates/egui_extras/src/loaders/gif_loader.rs b/crates/egui_extras/src/loaders/gif_loader.rs index 1c20135150c..5b1e710bc0f 100644 --- a/crates/egui_extras/src/loaders/gif_loader.rs +++ b/crates/egui_extras/src/loaders/gif_loader.rs @@ -131,4 +131,13 @@ impl ImageLoader for GifLoader { }) .sum() } + + fn frame_count(&self, uri: &str) -> usize { + let cache = self.cache.lock(); + if let Some(Ok(image)) = cache.get(uri) { + image.frames.len() + } else { + 0 + } + } }