Skip to content

Commit

Permalink
[memos] remove tesseract check
Browse files Browse the repository at this point in the history
  • Loading branch information
keltecc committed Nov 4, 2023
1 parent 54585ff commit 4b0f769
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions checkers/memos/memos.checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,18 @@ def do_get(request: gornilo.GetRequest) -> gornilo.Verdict:
actual_image_hash = hash_image(image)

if expected_image_hash != actual_image_hash:
return gornilo.Verdict.MUMBLE('image was changed')
return gornilo.Verdict.CORRUPT('flag was changed')

recognized_flag = recognize_text(image)
recognized_flag = recognized_flag.replace(' ', '').replace('\n', '')
recognized_flag = recognized_flag.replace('O', '0')
# recognized_flag = recognize_text(image)
# recognized_flag = recognized_flag.replace(' ', '').replace('\n', '')
# recognized_flag = recognized_flag.replace('O', '0')

recognized_flag = ''.join(
x for x in recognized_flag if x == '0' or x == '1'
)
# recognized_flag = ''.join(
# x for x in recognized_flag if x == '0' or x == '1'
# )

if recognized_flag != flag:
return gornilo.Verdict.CORRUPT(f'invalid flag')
# if recognized_flag != flag:
# return gornilo.Verdict.CORRUPT(f'invalid flag')

return gornilo.Verdict.OK()

Expand Down

0 comments on commit 4b0f769

Please sign in to comment.