modified logic in ocr capture photo
This commit is contained in:
@@ -328,6 +328,18 @@ function cameraCapture() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
async capturePhoto() {
|
||||||
|
const video = this.$refs.video;
|
||||||
|
const canvas = this.$refs.canvas;
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
canvas.width = video.videoWidth;
|
||||||
|
canvas.height = video.videoHeight;
|
||||||
|
ctx.drawImage(video, 0, 0);
|
||||||
|
|
||||||
|
const snapshot = this.$refs.snapshot;
|
||||||
|
snapshot.src = canvas.toDataURL('image/png');
|
||||||
|
|
||||||
snapshot.onload = () => {
|
snapshot.onload = () => {
|
||||||
snapshot.classList.remove('hidden');
|
snapshot.classList.remove('hidden');
|
||||||
video.classList.add('hidden');
|
video.classList.add('hidden');
|
||||||
@@ -356,7 +368,10 @@ function cameraCapture() {
|
|||||||
this.photoTaken = true;
|
this.photoTaken = true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
async uploadCroppedImage() {
|
async uploadCroppedImage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user