From d7b7b491b56d34e91c4a3c456db426ff13045fea Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Sat, 14 Feb 2026 20:27:31 +0000 Subject: [PATCH] docs: Add OCR requirements section to README and improve error handling Added to README.md: - New 'OCR Requirements (Optional)' section after Installation - Instructions for installing EasyOCR (recommended), Tesseract, or PaddleOCR - Note that Game Reader works without OCR, just shows 'not available' Improved Game Reader Test plugin: - Better error message when Tesseract binary is not installed - Provides download link and installation steps in error message - Updated Calibration tab to check if Tesseract binary is available - Shows recommendation to use EasyOCR in backend status This helps users understand why they get 'tesseract is not installed' errors and how to fix them. --- README.md | 27 +++++++++++++++++++++++++++ plugins/game_reader_test/plugin.py | 27 ++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d96fd4e..cdc845e 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,33 @@ python -m core.main --- +## šŸ“· OCR Requirements (Optional) + +For **Game Reader** and **Skill Scanner** plugins that use OCR (text recognition), you need to install one of these OCR engines: + +### Option 1: EasyOCR (Recommended - Auto-installs) +```bash +pip install easyocr +``` +EasyOCR downloads models automatically on first use. No additional setup needed. + +### Option 2: Tesseract (Alternative) +1. Download Tesseract installer: https://github.com/UB-Mannheim/tesseract/wiki +2. Install to `C:\Program Files\Tesseract-OCR\` +3. Add to PATH or install Python wrapper: +```bash +pip install pytesseract +``` + +### Option 3: PaddleOCR (Advanced) +```bash +pip install paddleocr +``` + +> ā„¹ļø **Note:** If no OCR engine is installed, the Game Reader plugin will show "OCR not available" but the rest of EU-Utility will work fine. + +--- + ## šŸ Quick Start ### First Launch diff --git a/plugins/game_reader_test/plugin.py b/plugins/game_reader_test/plugin.py index a4edee2..b6bc115 100644 --- a/plugins/game_reader_test/plugin.py +++ b/plugins/game_reader_test/plugin.py @@ -606,6 +606,16 @@ class GameReaderTestPlugin(BasePlugin): backend_used = "tesseract" except Exception as e: if backend == 'tesseract': + error_msg = str(e) + if "tesseract is not installed" in error_msg.lower() or "not in your path" in error_msg.lower(): + raise Exception( + "Tesseract is not installed.\n\n" + "To use Tesseract OCR:\n" + "1. Download from: https://github.com/UB-Mannheim/tesseract/wiki\n" + "2. Install to C:\\Program Files\\Tesseract-OCR\\\n" + "3. Add to PATH or restart EU-Utility\n\n" + "Alternatively, use EasyOCR (auto-installs): pip install easyocr" + ) raise e processing_time = time.time() - start_time @@ -782,21 +792,26 @@ class GameReaderTestPlugin(BasePlugin): try: import easyocr - statuses.append("āœ… EasyOCR - Available") + statuses.append("āœ… EasyOCR - Available (recommended)") except ImportError: - statuses.append("āŒ EasyOCR - Not installed (pip install easyocr)") + statuses.append("āŒ EasyOCR - Not installed\n Install: pip install easyocr") try: import pytesseract - statuses.append("āœ… Tesseract - Available") + # Also check if tesseract binary is available + try: + pytesseract.get_tesseract_version() + statuses.append("āœ… Tesseract - Available") + except Exception: + statuses.append("āš ļø Tesseract - Python wrapper installed but tesseract binary not found\n Install binary from: https://github.com/UB-Mannheim/tesseract/wiki") except ImportError: - statuses.append("āŒ Tesseract - Not installed (pip install pytesseract)") + statuses.append("āŒ Tesseract - Not installed\n Install: pip install pytesseract\n Then install binary from: https://github.com/UB-Mannheim/tesseract/wiki") try: from paddleocr import PaddleOCR statuses.append("āœ… PaddleOCR - Available") except ImportError: - statuses.append("āŒ PaddleOCR - Not installed (pip install paddleocr)") + statuses.append("āŒ PaddleOCR - Not installed\n Install: pip install paddleocr") try: from PIL import ImageGrab @@ -804,6 +819,8 @@ class GameReaderTestPlugin(BasePlugin): except ImportError: statuses.append("āŒ Screen Capture - PIL not available") + statuses.append("\nšŸ’” Recommendation: Use EasyOCR - it auto-installs required models") + self.backend_status.setPlainText('\n'.join(statuses)) def shutdown(self):