Skip to content

Commit de0832b

Browse files
committed
Removed baarcode scanner inbox, as we now have enough performance to apply the decoder to the full image
1 parent 614697b commit de0832b

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

assets/controllers/pages/barcode_scan_controller.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,13 @@ export default class extends Controller {
3333
connect() {
3434
console.log('Init Scanner');
3535

36-
//This function ensures, that the qrbox is 70% of the total viewport
37-
let qrboxFunction = function(viewfinderWidth, viewfinderHeight) {
38-
let minEdgePercentage = 0.7; // 70%
39-
let minEdgeSize = Math.min(viewfinderWidth, viewfinderHeight);
40-
let qrboxSize = Math.floor(minEdgeSize * minEdgePercentage);
41-
return {
42-
width: qrboxSize,
43-
height: qrboxSize
44-
};
45-
}
46-
4736
//Try to get the number of cameras. If the number is 0, then the promise will fail, and we show the warning dialog
4837
Html5Qrcode.getCameras().catch((devices) => {
4938
document.getElementById('scanner-warning').classList.remove('d-none');
5039
});
5140

5241
this._scanner = new Html5QrcodeScanner(this.element.id, {
5342
fps: 10,
54-
qrbox: qrboxFunction,
55-
experimentalFeatures: {
56-
//This option improves reading quality on android chrome
57-
useBarCodeDetectorIfSupported: true
58-
}
5943
}, false);
6044

6145
this._scanner.render(this.onScanSuccess.bind(this));

0 commit comments

Comments
 (0)