Skip to content

Commit

Permalink
Merge pull request #83 from dynobo/dev
Browse files Browse the repository at this point in the history
Add changelog; Update readme
  • Loading branch information
dynobo authored Oct 31, 2020
2 parents eecaa09 + 69efc6e commit 404fc48
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:**
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)_

Expand Down
6 changes: 4 additions & 2 deletions normcap/handlers/ocr_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.

0 comments on commit 404fc48

Please sign in to comment.