1
Fork 0

difficulty color recognition

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
prescientmoon 2024-07-31 17:51:03 +02:00
parent d7930cba5d
commit 6556e81433
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
3 changed files with 190 additions and 29 deletions
src/commands

View file

@ -123,7 +123,8 @@ pub async fn magic(
.content(format!("Image {}: reading difficulty", i + 1));
handle.edit(ctx, edited).await?;
let difficulty = match cropper.read_difficulty(&ocr_image, kind) {
// Do not use `ocr_image` because this reads the colors
let difficulty = match cropper.read_difficulty(&image, kind) {
// {{{ OCR error handling
Err(err) => {
error_with_image(
@ -140,6 +141,8 @@ pub async fn magic(
// }}}
Ok(d) => d,
};
println!("{difficulty:?}");
// }}}
// {{{ Jacket & distribution
let mut jacket_rect = None;