From 58951dcdc43962b184909d4064b0e6ebd05f513d Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 30 Oct 2025 14:51:56 +0530 Subject: [PATCH] chnaged logic in ocr --- resources/views/fields/camera-capture.blade.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/views/fields/camera-capture.blade.php b/resources/views/fields/camera-capture.blade.php index 524acb3..8eb3995 100644 --- a/resources/views/fields/camera-capture.blade.php +++ b/resources/views/fields/camera-capture.blade.php @@ -781,11 +781,15 @@ function cameraCapture() { } }, - async initWorker() { + async initWorker() { if (this.ocrWorker) return; - // ✅ Create and load OCR worker once - this.ocrWorker = await Tesseract.createWorker('eng'); + console.log("⏳ Loading OCR worker..."); + + this.ocrWorker = await Tesseract.createWorker({ + logger: info => console.log(info.status, info.progress) + }); + await this.ocrWorker.loadLanguage('eng'); await this.ocrWorker.initialize('eng'); this.isWorkerReady = true; @@ -793,6 +797,7 @@ function cameraCapture() { console.log("✅ OCR Worker Ready"); }, + async switchCamera() { this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user'; await this.initCamera();