I have the following situation, using the Instascan javascript plugin . What is happening is that the reading of the image of the QR code is giving it to me inverted, which can be seen with the text below the QR. This is causing me to slow down the reading of the QR code. Here is my code to see if you can help me.
Note: I am doing the tests with an android 4.4.2 Lenovo tablet
Code:
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
scanner.addListener('scan', function (content) {
//console.log(content);
window.location = "index.php?c=cajas&f=etiqueta&idqr="+content;
});
idCam = 1;
Instascan.Camera.getCameras().then(function (cameras) {
if (cameras.length > 0) {
var selectedCam = cameras[idCam];
$.each(cameras, (i, c) => {
if (c.name.indexOf('back') != -1) {
selectedCam = c;
return false;
}
});
scanner.start(cameras[idCam]);
} else {
console.error('No cameras found.');
}
}).catch(function (e) {
console.error(e);
});
Apparently it
Instascan.Scanner
comes by default with themirror
a attributetrue
. To avoid this you have to set it tofalse
when you instantiate the object:JAVA SCRIPT