我正试着和https://github.com/mebjas/html5-qrcode合作。是否有任何方法来读取CODE39扩展条形码,使用这个,或其他基于web的代码阅读器?我想阅读附加的条形码,例如:

发布于 2022-10-11 17:43:51
这是在您提供的映像中使用quaggajs (原始项目)的一个示例:
// -- commonjs usage --
const Quagga = require('quagga').default;
// -- ES6 usage --
// import Quagga from 'quagga';
Quagga.decodeSingle({
decoder: {
readers: ["code_39_reader"] // List of active readers
},
numOfWorkers: 0, // Needs to be 0 when used within node
locate: true, // try to locate the barcode in the image
src: 'c:/tmp/tYlHd.jpg' // or 'data:image/jpg;base64,' + data
}, function(result){
if (result.codeResult) {
console.log("result", result.codeResult.code);
} else {
console.log("not detected");
}
});控制台输出是:
result PAUT-953MAGENTA上面的用法是为了节点-js。在浏览器中使用时,请注释掉numOfWorkers:0行。
发布于 2022-11-07 00:12:08
你在哪个平台上测试这个?
您是否尝试过此配置(使用最新的库版本):
let html5QrcodeScanner = new Html5QrcodeScanner(
"reader",
{
fps: 10,
qrbox: {width: 250, height: 250},
useBarCodeDetectorIfSupported: true,
rememberLastUsedCamera: true,
aspectRatio: 4/3,
showTorchButtonIfSupported: true
});如果这不起作用,你能验证一下这个是否适合你吗:https://github.com/mebjas/html5-qrcode/tree/performance/minified
如果它仍然不起作用,请在https://github.com/mebjas/html5-qrcode/issues/new/choose上提交一个bug并提供更多信息,我将调查这个问题。
(作者在此)。
https://stackoverflow.com/questions/74017453
复制相似问题