No results from the scanner on > iOS 14
See original GitHub issueThe scanning functionality of Quagga stopped working. I tried different aspectRatios and different configurations regarding the camera selection without any success.
The camera selection, on the other hand, and general implementation work fine – the stream starts without any issues. No barcodes (ean_code) are recognized though.
Android works without any issues.
const QuaggaInit = () => {
Quagga.init(
{
inputStream: {
type: "LiveStream",
constraints: {
width: {
min: 450
},
height: {
min: 300
},
deviceId: selectedDevice ? selectedDevice : "default",
facingMode: "environment",
/*aspectRatio: {
"min": 1,
"max": 2
}*/
}
},
locator: {
"patchSize": "medium",
"halfSample": true
},
numOfWorkers: 2,
frequency: 10,
decoder: {
readers: [
"ean_reader",
]
},
locate: true
}, err => {
if (err) {
console.log(err, "error msg");
}
Quagga.start();
return () => {
Quagga.stop()
}
});
}
React.useEffect(() => {
getDevices();
checkPermissions();
Quagga.onProcessed(result => {
var drawingCtx = Quagga.canvas.ctx.overlay,
drawingCanvas = Quagga.canvas.dom.overlay;
if (result) {
if (result.boxes) {
drawingCtx.clearRect(
0,
0,
Number(drawingCanvas.getAttribute("width")),
Number(drawingCanvas.getAttribute("height"))
);
result.boxes
.filter(function (box) {
return box !== result.box;
})
.forEach(function (box) {
Quagga.ImageDebug.drawPath(box, { x: 0, y: 1 }, drawingCtx, {
color: "green",
lineWidth: 2
});
});
}
if (result.box) {
Quagga.ImageDebug.drawPath(result.box, { x: 0, y: 1 }, drawingCtx, {
color: "#00F",
lineWidth: 2
});
}
if (result.codeResult && result.codeResult.code) {
Quagga.ImageDebug.drawPath(
result.line,
{ x: "x", y: "y" },
drawingCtx,
{ color: "red", lineWidth: 3 }
);
}
}
});
Quagga.onDetected(detected);
}, []);
const detected = result => {
onDetected(result.codeResult.code);
};
Test device: iPhone 12 Pro
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top Results From Across the Web
Unable to scan QR Code via Camera - Apple Developer
After the update from iOS 13 to iOS 14, the functionality to scan bar code via the Camera app stopped working. A border...
Read more >How to Find iOS 14's Hidden Code Scanner App - Lifehacker
The “Code Scanner” app is already integrated into the iOS Camera ... Look up “Code Scanner,”; Select the app from the search results...
Read more >How to Fix Photos People Album Not Populating on iPhone
If your people photos folder won't finish scanning faces, learn what to do in this video. Free download for ReiBoot: ...
Read more >9 reasons Why Your QR Code is Not Working - Beaconstac blog
If your mobile device (Android or iPhone) still cannot scan the QR Code, try downloading a third-party QR Code scanning app. 4. Why...
Read more >Your iPhone has a hidden document scanner. This is how to ...
Not to mention a task from a decade ago. But you may have a scanner right in your hand: your iPhone or iPad....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting observation, I have not debugged it that in-depth.
just realized it’s aspectRatio: { ideal: 1 } …
might take a look through this thread for some ideas https://github.com/ericblade/quagga2/issues/419