Skip to content

Commit 81b27ce

Browse files
committed
fix: show optional barcode image
1 parent 96acb93 commit 81b27ce

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

App.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,18 @@ function startBarcodeScanner(context: any, withImage: boolean) {
173173

174174
const config: BarcodeScannerConfiguration = {
175175
topBarBackgroundColor: "#c8193c",
176-
barcodeImageGenerationType: (withImage ? "CAPTURED_IMAGE" : "NONE"),
176+
barcodeImageGenerationType: (withImage ? "FROM_VIDEO_FRAME" : "NONE"),
177177
barcodeFormats: BarcodeTypes.getAcceptedFormats(),
178178
// barcodeFormats: ["MSI_PLESSEY"],
179179
// msiPlesseyChecksumAlgorithm: "Mod10",
180180
// engineMode: "NEXT_GEN",
181181
};
182182

183-
if (withImage) {
184-
config.barcodeImageGenerationType = "FROM_VIDEO_FRAME";
185-
}
186-
187183
ScanbotBarcodeSdk.startBarcodeScanner(config)
188184
.then(result => {
189185
if (result.status === 'OK') {
190186
BarcodeResult.update(result);
187+
BarcodeResult.imageUri = result.imageFileUri;
191188
context.setState({ barcodeResultModalVisible: true});
192189
}
193190
})

0 commit comments

Comments
 (0)