Merge pull request #1248 from therealmate/image

fix: use the dimension of the image instead of the thumbnail's dimension
This commit is contained in:
Jeremy Soller 2025-10-09 13:24:35 -06:00 committed by GitHub
commit 52d0586a1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2271,12 +2271,11 @@ impl Item {
} }
} }
if let ItemThumbnail::Image(_, Some((width, height))) = self if let Some(path) = self.path_opt() {
.thumbnail_opt if let Ok(img) = image::image_dimensions(path) {
.as_ref() let (width, height) = img;
.unwrap_or(&ItemThumbnail::NotImage) details = details.push(widget::text::body(format!("{}x{}", width, height)));
{ }
details = details.push(widget::text::body(format!("{}x{}", width, height)));
} }
column = column.push(details); column = column.push(details);