From 7b99fbed004ff914c33c2762c8b40c32d7b3a557 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 15 Oct 2018 01:17:19 +0900 Subject: [PATCH] Update to image 0.20 --- Cargo.toml | 2 +- lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5d8d385..c64b1f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ opt-level = 3 cgmath = "*" glium = "0.22" glutin = "0.18" -image = { version = "0.18", features = ["png_codec"], optional = true } +image = { version = "0.20", features = ["png_codec"], optional = true } libxm = "1.0.0" rust-rocket = { path = "rust-rocket", optional = true } rand = "*" diff --git a/lib.rs b/lib.rs index 21e7a4c..3ec2b55 100644 --- a/lib.rs +++ b/lib.rs @@ -29,7 +29,7 @@ pub fn screenshot(display : &glium::Display) { let image = image::DynamicImage::ImageRgba8(image).flipv().to_rgb(); let image = image::DynamicImage::ImageRgb8(image); let mut output = std::fs::File::create(&std::path::Path::new("screenshot.png")).unwrap(); - image.save(&mut output, image::ImageFormat::PNG).unwrap(); + image.write_to(&mut output, image::ImageFormat::PNG).unwrap(); } #[cfg(not(feature = "image"))] -- 2.25.1