increased quality for jpeg image in ocr
This commit is contained in:
@@ -280,7 +280,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
<div class="flex space-x-4 mt-2">
|
||||
<x-filament::button color="primary" @click="capturePhoto" x-show="!photoTaken">Capture</x-filament::button>
|
||||
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
||||
<x-filament::button color="primary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
||||
<x-filament::button color="primary" @click="switchCamera" x-show="!photoTaken" class="inline-flex w-auto">Switch Camera</x-filament::button>
|
||||
<x-filament::button color="primary" @click="verify" x-show="photoTaken" class="inline-flex w-auto">Verify</x-filament::button>
|
||||
</div>
|
||||
@@ -355,7 +355,7 @@ function cameraCapture() {
|
||||
} else {
|
||||
alert('Failed to save image.');
|
||||
}
|
||||
}, 'image/jpeg');
|
||||
}, 'image/jpeg', 1.0); // 1.0 = highest quality
|
||||
|
||||
this.photoTaken = true;
|
||||
|
||||
@@ -415,6 +415,7 @@ function cameraCapture() {
|
||||
if (data.success) {
|
||||
const serials = Array.isArray(data.text) ? data.text.join("\n") : data.text;
|
||||
alert("OCR Result:\n" + serials);
|
||||
@this.set('ocrSerials', data.text);
|
||||
console.log(serials);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user