miijs 1.6.7 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1110,13 +1110,13 @@ module.exports={
|
|
|
1110
1110
|
const ctx = canvas.getContext('2d');
|
|
1111
1111
|
ctx.drawImage(img, 0, 0);
|
|
1112
1112
|
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
1113
|
-
qrCode = jsQR(imageData.data, imageData.width, imageData.height);
|
|
1113
|
+
qrCode = jsQR(imageData.data, imageData.width, imageData.height).binaryData;
|
|
1114
1114
|
}
|
|
1115
1115
|
else{
|
|
1116
1116
|
qrCode=binOrPath;
|
|
1117
1117
|
}
|
|
1118
1118
|
if (qrCode) {
|
|
1119
|
-
var data = decodeAesCcm(new Uint8Array(qrCode
|
|
1119
|
+
var data = decodeAesCcm(new Uint8Array(qrCode));
|
|
1120
1120
|
fs.writeFileSync("./decryptedTemp.3dMii",Buffer.from(data));
|
|
1121
1121
|
return Promise.resolve(readMii());
|
|
1122
1122
|
} else {
|
|
@@ -1230,8 +1230,7 @@ module.exports={
|
|
|
1230
1230
|
for(var i=0;i<toWrite.length;i++){
|
|
1231
1231
|
buffers.push(parseInt(toWrite[i],2));
|
|
1232
1232
|
}
|
|
1233
|
-
|
|
1234
|
-
fs.writeFileSync(outPath, buffer);
|
|
1233
|
+
fs.writeFileSync(outPath, Buffer.from(buffers));
|
|
1235
1234
|
},
|
|
1236
1235
|
write3DSQR:function(jsonIn,outPath){
|
|
1237
1236
|
var mii=jsonIn;
|
|
@@ -1757,7 +1756,7 @@ module.exports={
|
|
|
1757
1756
|
"col": "Black",
|
|
1758
1757
|
"mustacheSize": 4,
|
|
1759
1758
|
"mustacheYPos": 10
|
|
1760
|
-
}:dad.facialHair,
|
|
1759
|
+
}:Math.floor(Math.random()*2)===0?dad.facialHair:mom.facialHair,
|
|
1761
1760
|
"glasses":Math.floor(Math.random()*2)===1?dad.glasses:mom.glasses,
|
|
1762
1761
|
"mole":Math.floor(Math.random()*2)===1?dad.mole:mom.mole,
|
|
1763
1762
|
"creatorName":""
|