handle NaN in images
This commit is contained in:
@@ -7,6 +7,7 @@ impl From<String> for Image {
|
||||
#[inline]
|
||||
fn from(string: String) -> Image {
|
||||
let string = string.replace("\n", "");
|
||||
let string = string.replace("NaN", "0");
|
||||
let pixels: Vec<&str> = string.split("").collect();
|
||||
// the above seems to add an extra "" at the start and end of the vec, so strip them below
|
||||
let pixels = &pixels[1..(pixels.len() - 1)];
|
||||
|
||||
Reference in New Issue
Block a user