bhcli

A TUI for chatting on LE PHP Chats (onion)
git clone https://git.dasho.dev/n0tr1v/bhcli.git
Log | Files | Refs | README

commit eec4202c7df15a7c2529cb8a7b8eb7f3008a628b
parent 6b6c01b8f28addd3df211bd714628529d3f701d2
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 30 Mar 2023 01:47:13 -0700

cleanup

Diffstat:
Msrc/lechatphp/mod.rs | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lechatphp/mod.rs b/src/lechatphp/mod.rs @@ -443,13 +443,13 @@ fn get_pixel_in_bound(img: &DynamicImage, x: u32, y: u32) -> Option<Rgba<u8>> { } // give an image and a valid letter image, return either or not the letter is in that image. -fn img_contains_letter(img: &DynamicImage, letter_img1: &DynamicImage) -> bool { - for y in 0..letter_img1.dimensions().1 { - for x in 0..letter_img1.dimensions().0 { - if let Some(good_letter_color) = get_pixel_in_bound(letter_img1, x, y) { +fn img_contains_letter(img: &DynamicImage, letter_img: &DynamicImage) -> bool { + for y in 0..14 { + for x in 0..8 { + if let Some(good_letter_color) = get_pixel_in_bound(letter_img, x, y) { if let Some(letter_img_color) = get_pixel_in_bound(img, x, y) { // If we find an Off pixel where it's supposed to be On, skip that letter - if (good_letter_color == *ON_COLOR || good_letter_color == *RED_COLOR) && + if good_letter_color == *ON_COLOR && (letter_img_color != *ON_COLOR && letter_img_color != *RED_COLOR) { return false; }