Update webcam data management
This commit is contained in:
@@ -193,7 +193,7 @@ function setup_events(){
|
||||
ev.preventDefault();
|
||||
try {
|
||||
await countDownToPicture(); // wait for countdown to finish
|
||||
const data = await take_picture(); // take_picture can be async
|
||||
var data = await take_picture(); // take_picture can be async
|
||||
print_picture(data);
|
||||
} catch (e) {
|
||||
alert("Failed to print a picture because : " + e);
|
||||
@@ -212,6 +212,10 @@ function clear_canvas() {
|
||||
}
|
||||
|
||||
function dataURLtoFile(dataurl, filename) {
|
||||
if(dataurl === "") {
|
||||
console.log("We didn't receive data");
|
||||
}
|
||||
|
||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
||||
while(n--){
|
||||
|
||||
Reference in New Issue
Block a user