mubaidr / Javascript-Barcode-Reader

Simple and Fast Barcode decoder with support of Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8 barcodes in javascript.
https://mubaidr.js.org/Javascript-Barcode-Reader/
MIT License
192 stars 28 forks source link

Issue reading code-128 sample #1231

Open cfjedimaster opened 1 year ago

cfjedimaster commented 1 year ago

Describe the bug I'm having an issue with a barcode in Code-128B format. I used this site, https://www.barcodesinc.com/generator/index.php, to generate t his image:

fileoutpart3

When using this simple code,

async function getBarcode(path) {
    console.log(path);
    let result = await jsBarcodeReader({ 
        barcode:'code-128',
        image:path
    });
    return result;

}

I get: ???r????3?uu?????}????????????

To Reproduce See above code and sample. :)

Expected behavior A URL.

Desktop (please complete the following information):

mubaidr commented 1 year ago

This is strange, I have tested the generated barcode and it only works if you set Bar width: to 3px

You can check it online here: https://codesandbox.io/s/javascript-barcode-reader-forked-2xj9y3?file=/src/index.js

mubaidr commented 1 year ago

BTW code generated by this website: https://barcode.tec-it.com/en/?data=https%3A%2F%2Fwww.raymondcamend.com

is read fine, maybe there is some specification or version information I have missed?