Skip to content

Commit

Permalink
fix: Unsupport language
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jul 31, 2023
1 parent 0302fc4 commit 44c7ce7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ pot screenshot_ocr without_screenshot # Screenshot OCR(without screenshot)
pot screenshot_translate without_screenshot # Screenshot Translate(without screenshot)
```

Example for Gnome:

![](./asset/shortcut.png)

## Screenshot doesn't work

In some pure Wayland desktop environments/window managers (such as Hyprland), the built-in screenshot feature of pot cannot be used. In this case, you can use other screenshot tools instead by using command line parameters. Simply save the screenshot to `~/.cache/com.pylogmon.pot/pot_screenshot_cut.png` and then execute `pot screenshot_ocr without_screenshot`.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces_ocr/paddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var det, rec, dic;

export async function ocr(base64, lang, setText, id) {
const { supportLanguage } = info;
if (!lang in supportLanguage) {
if (!(lang in supportLanguage)) {
throw 'Unsupported Language';
}
const res = await axios.get(`/ocr/${supportLanguage[lang]}/dict.txt`);
Expand Down

0 comments on commit 44c7ce7

Please sign in to comment.