// SPDX-License-Identifier: MPL-2.0 OR LGPL-2.1-or-later use gdk::prelude::*; use glycin::Loader; fn main() { let Some(path) = std::env::args().nth(1) else { std::process::exit(2) }; let _ = async_io::block_on(render(&path)); } async fn render

(path: P) -> Result<(), Box> where P: AsRef, { let file = gio::File::for_path(path); let image = Loader::new(file).load().await.expect("request failed"); let frame = image.next_frame().await.expect("next frame failed"); frame.texture().save_to_png("output.png")?; Ok(()) }