Added png instead of jpeg in ocr

This commit is contained in:
dhanabalan
2025-10-24 11:32:46 +05:30
parent 50cfc60f04
commit 095929805f

View File

@@ -329,13 +329,13 @@ function cameraCapture() {
// Show snapshot // Show snapshot
const snapshot = this.$refs.snapshot; const snapshot = this.$refs.snapshot;
snapshot.src = canvas.toDataURL('image/jpeg'); snapshot.src = canvas.toDataURL('image/png');
snapshot.classList.remove('hidden'); snapshot.classList.remove('hidden');
video.classList.add('hidden'); video.classList.add('hidden');
// Convert canvas to file // Convert canvas to file
canvas.toBlob(async blob => { canvas.toBlob(async blob => {
const file = new File([blob], 'capture.jpeg', { type: 'image/jpeg' }); const file = new File([blob], 'capture.png', { type: 'image/png' });
console.log("File ready for upload:", file); console.log("File ready for upload:", file);
// Upload to temp folder // Upload to temp folder
@@ -355,7 +355,7 @@ function cameraCapture() {
} else { } else {
alert('Failed to save image.'); alert('Failed to save image.');
} }
}, 'image/jpeg', 1.0); // 1.0 = highest quality }, 'image/png', 1.0); // 1.0 = highest quality
this.photoTaken = true; this.photoTaken = true;