Update to image 0.20
authorBernie Innocenti <codewiz@google.com>
Sun, 14 Oct 2018 16:17:19 +0000 (01:17 +0900)
committerBernie Innocenti <codewiz@google.com>
Sun, 14 Oct 2018 16:17:19 +0000 (01:17 +0900)
Cargo.toml
lib.rs

index 5d8d3852693bba09231081291ee0e8a1cebf2b94..c64b1f98d2eda24c990366c2cb7cceef57aac627 100644 (file)
@@ -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 21e7a4cb5da748a70ff29479742999f38d626466..3ec2b55117d9850a3dae3a59f122ceba6a32202e 100644 (file)
--- 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"))]