I’m trying to generate a barcode on the web from the png image. I’m using “jsqr” library. My code looks like this:
loadBarcodeImage() async {
Uint8List? image = await fileUtils.getFileFromLocal(['jpg', 'jpeg', 'png']);
chosenBarcodeImage = image;
Uint8ClampedList clampedList = image!.buffer.asUint8ClampedList();
js.JsArray js_array = js.JsArray.from(clampedList);
callUIBarcodeScanner(js_array);
}
callUIBarcodeScanner(dynamic barcodeImage) {
var barcode = jsqr.jsQR(barcodeImage, 100, 100);
print(barcode);
}
I had been tried a couple of other list types but still getting:
Malformed data passed to binarizer.
at Object.e.binarize (https://cdn.jsdelivr.net/npm/[email protected]/dist/jsQR.min.js:7:6194)
at l (https://cdn.jsdelivr.net/npm/[email protected]/dist/jsQR.min.js:7:5602)
```...
Please, help