Open nasqasim opened 1 year ago
I am also experiencing this issue with UPC-A, UPC-E, EAN-13, EAN-8 and ITF. It is consistently scanning, but produces random numbers approximately 2 out of 5 times. This is happening on all device types. Chrome browser, Android Pixel 4a, iPhone XR, iPhone SE etc.
Ah, I am able to reproduce this. This should be due to error in underlying system.
Let me see what can be done on my end to address this.
@mebjas great, thank you! Let me know if there is anything I can help with.
any updates?
seems that if i upload the barcode image it will decode it correctly... i tried with zxing-js-scanner and it works:
<script src="{{ asset('js/zxing-library-0.20.0.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
//https://github.com/zxing-js/library srcjs: https://unpkg.com/@zxing/library@latest/umd/index.min.js
const constraints = {
audio: false,
video: {
facingMode: { exact: "environment" },
width: { ideal: 200 },
height: { ideal: 300 }
}
};
const codeReader = new ZXing.BrowserMultiFormatReader();
codeReader.decodeOnceFromConstraints(constraints, 'video')
.then(result => {
$('#codice_articolo').val("");
$('#codice_articolo').val(result.text);
$('#video').hide();
$('#quantita_rilevata').focus();
codeReader.reset();
})
.catch(err => {
// Display a Bootstrap alert with the error message
const alertContainer = $('#alert-container');
const errorMessage = err.message && 'Errore! prova a ricaricare la pagina e consenti a questo sito di accedere alla fotocamera.';
const alertHtml = `
<div class="alert alert-danger alert-dismissible fade show" role="alert">
${errorMessage}
</div>
`;
alertContainer.html(alertHtml);
});
});
</script>
EDIT: maybe we need to update this library with the latest zxing js?
Any update on this? struggling with the same issue.
Describe the bug Trying to scan a CODE_39 type barcode and getting different results
To Reproduce Steps to reproduce the behavior:
Expected behavior Getting different results when scanning each time
Screenshots