fix: use the dimension of the image instead of the thumbnail's dimension

Fixes https://github.com/pop-os/cosmic-files/issues/1244
This commit is contained in:
therealmate 2025-10-05 22:20:35 +02:00 committed by therealmate
parent c42e37b2dd
commit 23dd824746
No known key found for this signature in database
GPG key ID: 1F18444027437CBD

View file

@ -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);