From 69efc6ef28727f7ba5890f2915ba491a8384a0a4 Mon Sep 17 00:00:00 2001 From: dynobo Date: Sat, 31 Oct 2020 10:52:36 +0100 Subject: [PATCH] Add changelog; Update readme --- CHANGELOG.md | 11 +++++++++++ README.md | 6 ++---- normcap/handlers/ocr_handler.py | 6 ++++-- ressource/{normcap.gif => normcap} | Bin 4 files changed, 17 insertions(+), 6 deletions(-) rename ressource/{normcap.gif => normcap} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3df23fb..88d78818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v0.1.5 (2020-10-31) + +**Changes:** + +- Fixes Issue #81: Unhandled exception when user selected no region +- Related to the one above: Skip OCR if selected area is tiny (below 25 square pixels) + +**Development related:** +- Updates dependencies which also now get pinned +- Move away from pipenv, using plain setuptools and requirements.txt's instead. + ## v0.1.4 (2020-04-25) **Changes:** diff --git a/README.md b/README.md index 77319bb3..ee675e4f 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,7 @@ 2. Select a region on the screen 3. Retrieve recognized text in clipboard -![](https://raw.githubusercontent.com/dynobo/normcap/master/ressource/normcap.gif) - -([Screencast on GitHub](https://raw.githubusercontent.com/dynobo/normcap/master/ressource/normcap.gif)) +[![Screencast](https://raw.githubusercontent.com/dynobo/normcap/master/ressource/normcap)](https://raw.githubusercontent.com/dynobo/normcap/master/ressource/normcap) ## Installation @@ -67,7 +65,7 @@ pip install normcap (**_OR_** download and extract binary package from the [latest release](https://github.com/dynobo/normcap/releases)) -3\. Execute `./normcap` +3\. Execute `normcap` ### On Windows _(recommended method)_ diff --git a/normcap/handlers/ocr_handler.py b/normcap/handlers/ocr_handler.py index 4a6eb97c..b63c3dfd 100644 --- a/normcap/handlers/ocr_handler.py +++ b/normcap/handlers/ocr_handler.py @@ -40,8 +40,10 @@ def handle(self, request: NormcapData) -> NormcapData: return request def img_to_dict(self, img, lang) -> list: - if not img.size or img.size[0] * img.size[1] <= 10: - self._logger.warning("Image too small for OCR. Dimensions: %s", img.size) + if not img.size or img.size[0] * img.size[1] <= 25: + self._logger.info( + "Selected region of %s too small for OCR. Skipping.", img.size + ) return [] img.format = "PNG" # WORKAROUND for a pyinstaller bug on Win diff --git a/ressource/normcap.gif b/ressource/normcap similarity index 100% rename from ressource/normcap.gif rename to ressource/normcap