Use glycin 3.0 so work with 2+ loaders

This commit is contained in:
Sophie Herold 2025-06-18 20:29:57 +02:00
parent cf8d17f2af
commit 020ea74ba9
7 changed files with 117 additions and 52 deletions

View file

@ -3,6 +3,7 @@
// Copyright (c) 2023 Christopher Davis
// Copyright (c) 2024 Andre Klapper
// Copyright (c) 2024 Dexter Reed
// Copyright (c) 2025 sid
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View file

@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Sophie Herold
// Copyright (c) 2023-2025 Sophie Herold
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -59,7 +59,7 @@ impl Glycin {
log::trace!("Image info received");
let mut metadata: Metadata = Metadata::default();
metadata.set_image_info(image.info().details.clone());
metadata.set_image_info(image.info().clone());
metadata.set_mime_type(image.mime_type().to_string());
updater.send(DecoderUpdate::Metadata(Box::new(metadata)));

View file

@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Sophie Herold
// Copyright (c) 2023-2025 Sophie Herold
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -77,7 +77,7 @@ impl Svg {
let image = loader.load().await?;
let mut metadata: Metadata = Metadata::default();
metadata.set_image_info(image.info().details.clone());
metadata.set_image_info(image.info().clone());
metadata.set_mime_type(image.mime_type().to_string());
updater.send(DecoderUpdate::Metadata(Box::new(metadata)));

View file

@ -25,7 +25,7 @@ use std::str::FromStr;
use chrono::prelude::*;
pub use file::FileInfo;
use glib::TimeZone;
use glycin::{Frame, FrameDetails, ImageInfoDetails, MemoryFormat};
use glycin::{Frame, FrameDetails, ImageInfo, MemoryFormat};
use gufo::common::datetime::DateTime;
use gufo::common::orientation::Orientation;
@ -38,7 +38,7 @@ pub struct Metadata {
mime_type: Option<String>,
metadata: gufo::Metadata,
file_info: Option<FileInfo>,
image_info: Option<glycin::ImageInfoDetails>,
image_info: Option<glycin::ImageInfo>,
frame_info: Option<FrameDetails>,
memory_format: Option<MemoryFormat>,
}
@ -60,7 +60,7 @@ impl Metadata {
}
}
pub fn set_image_info(&mut self, image_info: ImageInfoDetails) {
pub fn set_image_info(&mut self, image_info: ImageInfo) {
if let Some(exif_raw) = image_info.exif.as_ref().and_then(|x| x.get_full().ok()) {
self.set_exif_bytes(exif_raw);
}