From 23dd824746a31c89807bc58703ee63e94bc63fc9 Mon Sep 17 00:00:00 2001 From: therealmate <61843503+therealmate@users.noreply.github.com> Date: Sun, 5 Oct 2025 22:20:35 +0200 Subject: [PATCH] fix: use the dimension of the image instead of the thumbnail's dimension Fixes https://github.com/pop-os/cosmic-files/issues/1244 --- src/tab.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index 15d0cf3..65ba848 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -2271,12 +2271,11 @@ impl Item { } } - if let ItemThumbnail::Image(_, Some((width, height))) = self - .thumbnail_opt - .as_ref() - .unwrap_or(&ItemThumbnail::NotImage) - { - details = details.push(widget::text::body(format!("{}x{}", width, height))); + if let Some(path) = self.path_opt() { + if let Ok(img) = image::image_dimensions(path) { + let (width, height) = img; + details = details.push(widget::text::body(format!("{}x{}", width, height))); + } } column = column.push(details);