优化摄像头拍照图片格式

This commit is contained in:
java110 2020-05-20 10:52:03 +08:00
parent 2e5e7b60a2
commit 4abec1f69c
3 changed files with 3 additions and 3 deletions

View File

@ -188,7 +188,7 @@
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
var data = canvas.toDataURL('image/webp');
var data = canvas.toDataURL('image/jpeg',1.0);
vc.component.addOwnerInfo.ownerPhoto = data;
//document.getElementById('photo').setAttribute('src', data);
}

View File

@ -355,7 +355,7 @@
canvas.width = takeEditVideo.videoWidth;
canvas.height = takeEditVideo.videoHeight;
canvas.getContext('2d').drawImage(takeEditVideo, 0, 0);
var data = canvas.toDataURL('image/webp');
var data = canvas.toDataURL('image/jpeg',1.0);
vc.component.editApplicationKeyInfo.photo = data;
//document.getElementById('photo').setAttribute('src', data);
}

View File

@ -194,7 +194,7 @@
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
var data = canvas.toDataURL('image/webp');
var data = canvas.toDataURL('image/jpeg',1.0);
vc.component.editOwnerInfo.ownerPhoto = data;
//document.getElementById('photo').setAttribute('src', data);
}