Compare commits
2 Commits
16c1ef4d72
...
f2d9006a12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2d9006a12 | ||
|
|
52e0a09552 |
@@ -1,5 +1,8 @@
|
|||||||
# Configuration file the LittlePrynter
|
# Configuration file the LittlePrynter
|
||||||
|
|
||||||
|
[defaults]
|
||||||
|
signature = "Anonymous"
|
||||||
|
|
||||||
# Printer settings
|
# Printer settings
|
||||||
[printer]
|
[printer]
|
||||||
vendor_id = "0x04b8"
|
vendor_id = "0x04b8"
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ function setup_events(){
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
try {
|
try {
|
||||||
await countDownToPicture(); // wait for countdown to finish
|
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);
|
print_picture(data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert("Failed to print a picture because : " + e);
|
alert("Failed to print a picture because : " + e);
|
||||||
@@ -212,6 +212,10 @@ function clear_canvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dataURLtoFile(dataurl, filename) {
|
function dataURLtoFile(dataurl, filename) {
|
||||||
|
if(dataurl === "") {
|
||||||
|
console.log("We didn't receive data");
|
||||||
|
}
|
||||||
|
|
||||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
||||||
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
||||||
while(n--){
|
while(n--){
|
||||||
|
|||||||
Reference in New Issue
Block a user