zxingReadBarcodeImagePath function
Reads barcode from XFile image path
Implementation
Future<Code> zxingReadBarcodeImagePath(XFile path, DecodeParams params) async {
final Uint8List imageBytes = await path.readAsBytes();
imglib.Image? image = imglib.decodeImage(imageBytes);
if (image == null) {
return Code();
}
image = resizeToMaxSize(image, params.maxSize);
params.width = image.width;
params.height = image.height;
return zxingReadBarcode(rgbBytes(image), params);
}