From 557213acc1858bebf73f2dbbe239d19deeec5213 Mon Sep 17 00:00:00 2001 From: Waheed Ahmed Date: Mon, 29 Jul 2019 16:49:40 +0500 Subject: [PATCH] Fix image cropping and submission for photo ID verify. Using the available video resolution increasing the image and request size and server started failing requests. Fixed it by using canvas width and height. PROD-499 --- lms/static/js/verify_student/views/webcam_photo_view.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lms/static/js/verify_student/views/webcam_photo_view.js b/lms/static/js/verify_student/views/webcam_photo_view.js index 42560a2074..2733ecd215 100644 --- a/lms/static/js/verify_student/views/webcam_photo_view.js +++ b/lms/static/js/verify_student/views/webcam_photo_view.js @@ -55,9 +55,7 @@ if (this.stream) { video = this.getVideo(); canvas = this.getCanvas(); - canvas.width = video.videoWidth; - canvas.height = video.videoHeight; - canvas.getContext('2d').drawImage(video, 0, 0); + canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height); video.pause(); return true; }