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:
commit
52d0586a1b
1 changed files with 5 additions and 6 deletions
11
src/tab.rs
11
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue