Skip to content

Commit 52d0586

Browse files
authored
Merge pull request #1248 from therealmate/image
fix: use the dimension of the image instead of the thumbnail's dimension
2 parents ffcd25e + 23dd824 commit 52d0586

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/tab.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,12 +2271,11 @@ impl Item {
22712271
}
22722272
}
22732273

2274-
if let ItemThumbnail::Image(_, Some((width, height))) = self
2275-
.thumbnail_opt
2276-
.as_ref()
2277-
.unwrap_or(&ItemThumbnail::NotImage)
2278-
{
2279-
details = details.push(widget::text::body(format!("{}x{}", width, height)));
2274+
if let Some(path) = self.path_opt() {
2275+
if let Ok(img) = image::image_dimensions(path) {
2276+
let (width, height) = img;
2277+
details = details.push(widget::text::body(format!("{}x{}", width, height)));
2278+
}
22802279
}
22812280
column = column.push(details);
22822281

0 commit comments

Comments
 (0)