properties_view: Use physical size and resolution
Replace the API that got removed from glycin
This commit is contained in:
parent
ffe42a7c6c
commit
c7223f6f69
11 changed files with 254 additions and 101 deletions
|
|
@ -30,6 +30,7 @@ use glib::TimeZone;
|
|||
use glycin::{Frame, FrameDetails, ImageDetails, MemoryFormat};
|
||||
use gufo::common::datetime::DateTime;
|
||||
use gufo::common::orientation::Orientation;
|
||||
use gufo::common::physical_dimension;
|
||||
|
||||
use crate::deps::*;
|
||||
use crate::util;
|
||||
|
|
@ -169,16 +170,6 @@ impl Metadata {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn dimensions_inch(&self) -> Option<(f64, f64)> {
|
||||
self.image_info.as_ref().and_then(|x| x.dimensions_inch())
|
||||
}
|
||||
|
||||
pub fn dimensions_text(&self) -> Option<String> {
|
||||
self.image_info
|
||||
.as_ref()
|
||||
.and_then(|x| x.info_dimensions_text().map(|x| x.to_string()))
|
||||
}
|
||||
|
||||
pub fn file_name(&self) -> Option<String> {
|
||||
self.file_info.as_ref().map(|x| x.display_name.to_string())
|
||||
}
|
||||
|
|
@ -436,4 +427,12 @@ impl Metadata {
|
|||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pixel_density(&self) -> Option<physical_dimension::PixelDensity> {
|
||||
self.frame_info.as_ref().and_then(|x| x.pixel_density())
|
||||
}
|
||||
|
||||
pub fn physical_size(&self) -> Option<physical_dimension::PhysicalSize> {
|
||||
self.frame_info.as_ref().and_then(|x| x.physical_size())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue