decoder: Use glycin 1.0
This commit is contained in:
parent
0e490f38ad
commit
f14cb540eb
9 changed files with 124 additions and 99 deletions
|
|
@ -15,14 +15,16 @@
|
|||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
use crate::util::gettext::*;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ImageFormat {
|
||||
mime_type: glycin::MimeType,
|
||||
name: String,
|
||||
name: Option<String>,
|
||||
}
|
||||
|
||||
impl ImageFormat {
|
||||
pub fn new(mime_type: glycin::MimeType, name: String) -> Self {
|
||||
pub fn new(mime_type: glycin::MimeType, name: Option<String>) -> Self {
|
||||
Self { mime_type, name }
|
||||
}
|
||||
|
||||
|
|
@ -40,6 +42,10 @@ impl ImageFormat {
|
|||
|
||||
impl std::fmt::Display for ImageFormat {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||
write!(f, "{}", self.name)
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
self.name.clone().unwrap_or_else(|| gettext("Unknown"))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ impl GPSCoord {
|
|||
}
|
||||
|
||||
fn position_exif(position: &[exif::Rational]) -> Option<(f64, Option<f64>, Option<f64>)> {
|
||||
let (deg, mut min, mut sec) = (position.get(0)?, position.get(1), position.get(2));
|
||||
let (deg, mut min, mut sec) = (position.first()?, position.get(1), position.get(2));
|
||||
|
||||
if let (Some(min_), Some(sec_)) = (min, sec) {
|
||||
if min_.denom > 1 && sec_.num == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue