zxingReadBarcodesImageUrl function
Reads barcodes from image url
Implementation
Future<Codes> zxingReadBarcodesImageUrl(String url, DecodeParams params) async {
final Uint8List imageBytes =
(await NetworkAssetBundle(Uri.parse(url)).load(url)).buffer.asUint8List();
imglib.Image? image = imglib.decodeImage(imageBytes);
if (image == null) {
return Codes();
}
image = resizeToMaxSize(image, params.maxSize);
params.width = image.width;
params.height = image.height;
return zxingReadBarcodes(rgbBytes(image), params);
}