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.classList.remove('hidden');
|
||||
video.classList.add('hidden');
|
||||
@@ -356,8 +368,11 @@ function cameraCapture() {
|
||||
this.photoTaken = true;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
async uploadCroppedImage() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user