Skip to content

Commit

Permalink
Update lodepng dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
flosse committed Oct 26, 2020
1 parent b67da7f commit 08f41d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ image = "0.23"
rand = "0.3.15"
serde_json = "1.0"
base64 = "0.13"
lodepng = "1.1.0"
lodepng = "3.2"

[dev-dependencies]
time = "0.2"
5 changes: 2 additions & 3 deletions src/images/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use image::ImageResult as Result;
use std::cmp::{max, min};
use std::iter::FromIterator;
use std::path::Path;

use image::{load_from_memory, ImageBuffer, Rgb, RgbImage};
Expand Down Expand Up @@ -111,9 +110,9 @@ impl Image {
let w = self.img.width() as usize;
let h = self.img.height() as usize;
let i = self.img.clone().into_raw();
match lodepng::encode_memory(&i, w, h, lodepng::ColorType::LCT_RGB, 8) {
match lodepng::encode_memory(&i, w, h, lodepng::ColorType::RGB, 8) {
Err(_) => None,
Ok(v) => Some(Vec::from_iter(v.as_ref().iter().cloned())),
Ok(v) => Some(v),
}
}
}

0 comments on commit 08f41d6

Please sign in to comment.