enforced ASCII validation on '--map' flag

This commit is contained in:
2023-02-08 22:09:18 +01:00
parent 2b9817080e
commit 529b6a61e2
2 changed files with 7 additions and 1 deletions

View File

@@ -17,7 +17,6 @@ fn to_ascii(char_map: String, image: DynamicImage) -> Vec<Vec<Ascii>> {
for pixel in image.pixels() {
let ch = char_map.as_bytes()[((get_color(pixel.2) as f32-1.0)/255f32 * l) as usize];
//fixme: might break with non-ASCII char_map
str.push(Ascii::new(ch, pixel.2[0], pixel.2[1], pixel.2[2]));
if pixel.0 == image.width()-1 {