zxingReadBarcodesImagePath function
Reads barcodes from XFile image path
Returns Codes carrying an error instead of throwing when the file cannot
be read or decoded.
Implementation
Future<Codes> zxingReadBarcodesImagePath(
XFile path,
DecodeParams params,
) async {
final _DecodedImage decoded = await _decodeImageFile(path, params);
if (decoded.error != null) {
return _errorCodes(decoded.error!);
}
return _readBarcodes(
decoded.bytes!,
decoded.params!,
CodeSource.localImageFile,
);
}