cargo: Update to glycin 1.0.beta.2

This commit is contained in:
Sophie Herold 2024-02-22 01:23:06 +01:00
parent cde03f844f
commit 006d3dc5b4
7 changed files with 24 additions and 23 deletions

View file

@ -49,14 +49,14 @@ impl Glycin {
updater.clone().spawn_error_handled(async move {
log::trace!("Setting up loader");
let mut image_request = glycin::Loader::new(file);
let mut loader = glycin::Loader::new(file);
#[cfg(feature = "disable-glycin-sandbox")]
image_request.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
image_request.cancellable(cancellable_);
loader.cancellable(cancellable_);
let image = image_request.request().await?;
let image = loader.load().await?;
log::trace!("Image info received");
let mut metadata: Metadata = Metadata::default();

View file

@ -69,14 +69,14 @@ impl Svg {
let (wakeup, wakeup_resv) = mpsc::unbounded();
updater.clone().spawn_error_handled(async move {
let mut image_request = glycin::Loader::new(file);
let mut loader = glycin::Loader::new(file);
#[cfg(feature = "disable-glycin-sandbox")]
image_request.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
image_request.cancellable(cancellable.clone());
loader.cancellable(cancellable.clone());
let image = image_request.request().await?;
let image = loader.load().await?;
let mut metadata: Metadata = Metadata::default();
metadata.set_image_info(image.info().details.clone());
@ -174,12 +174,12 @@ impl Svg {
pub fn render_print(file: &gio::File, width: i32, height: i32) -> anyhow::Result<gdk::Texture> {
#[allow(unused_mut)]
let mut image_request = glycin::Loader::new(file.clone());
let mut loader = glycin::Loader::new(file.clone());
#[cfg(feature = "disable-glycin-sandbox")]
image_request.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
let image = futures_lite::future::block_on(image_request.request())?;
let image = futures_lite::future::block_on(loader.load())?;
let frame_request = glycin::FrameRequest::new().scale(width as u32, height as u32);
let frame = futures_lite::future::block_on(image.specific_frame(frame_request))?;

View file

@ -74,8 +74,8 @@ impl Metadata {
}
pub fn set_image_info(&mut self, image_info: ImageInfoDetails) {
if let Some(exif_raw) = image_info.exif.as_ref() {
self.set_exif_bytes(exif_raw.clone());
if let Some(exif_raw) = image_info.exif.as_ref().and_then(|x| x.get_full().ok()) {
self.set_exif_bytes(exif_raw);
}
self.image_info = Some(image_info);
}

View file

@ -566,7 +566,7 @@ impl LpWindow {
let filter_supported_formats = gtk::FileFilter::new();
filter_supported_formats.set_name(Some(&gettext("Supported image formats")));
for mime_type in glycin::image_formats().await {
for mime_type in glycin::supported_mime_types().await {
filter_supported_formats.add_mime_type(&mime_type);
}