handle NaN in images
This commit is contained in:
parent
f899f03dbe
commit
b2f601e778
|
@ -66,7 +66,6 @@ some more practical uses would be things like:
|
|||
* add Bitsy HD and Bitsy 7.0 test data
|
||||
* fix variables/endings becoming "DLG DLG"?
|
||||
* dedupe "animation frames from string" functionality
|
||||
* handle NaN in images (convert to 0? investigate)
|
||||
|
||||
### tidy up
|
||||
|
||||
|
|
|
@ -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)];
|
||||
|
|
Loading…
Reference in New Issue