Skip to content

Commit 9fe8e63

Browse files
committed
Updated
1 parent 7d1f5e7 commit 9fe8e63

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

src/app/mrz-reader/mrz-reader.component.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,24 @@ export class MrzReaderComponent implements OnInit {
2626
this.overlayManager.initOverlay(document.getElementById('overlay') as HTMLCanvasElement);
2727

2828
(async () => {
29-
await CodeParserModule.loadSpec("MRTD_TD1_ID");
30-
await CodeParserModule.loadSpec("MRTD_TD2_FRENCH_ID");
31-
await CodeParserModule.loadSpec("MRTD_TD2_ID");
32-
await CodeParserModule.loadSpec("MRTD_TD2_VISA");
33-
await CodeParserModule.loadSpec("MRTD_TD3_PASSPORT");
34-
await CodeParserModule.loadSpec("MRTD_TD3_VISA");
35-
36-
await LabelRecognizerModule.loadRecognitionData("MRZ");
37-
this.cvr = await CaptureVisionRouter.createInstance();
38-
this.parser = await CodeParser.createInstance();
39-
let ret = await this.cvr.initSettings('/assets/template.json');
40-
console.log(ret);
29+
try {
30+
await CodeParserModule.loadSpec("MRTD_TD1_ID");
31+
await CodeParserModule.loadSpec("MRTD_TD2_FRENCH_ID");
32+
await CodeParserModule.loadSpec("MRTD_TD2_ID");
33+
await CodeParserModule.loadSpec("MRTD_TD2_VISA");
34+
await CodeParserModule.loadSpec("MRTD_TD3_PASSPORT");
35+
await CodeParserModule.loadSpec("MRTD_TD3_VISA");
36+
37+
await LabelRecognizerModule.loadRecognitionData("MRZ");
38+
this.cvr = await CaptureVisionRouter.createInstance();
39+
this.parser = await CodeParser.createInstance();
40+
let ret = await this.cvr.initSettings('/assets/template.json');
41+
console.log(ret);
42+
}
43+
catch (ex) {
44+
alert(ex);
45+
// console.error(ex);
46+
}
4147
this.isLoaded = true;
4248
})();
4349
}

src/app/product-list/product-list.component.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ export class ProductListComponent {
2727
this.processedText = this.inputText.toUpperCase();
2828
// Configure the paths where the .wasm files and other necessary resources for modules are located.
2929
CoreModule.engineResourcePaths = {
30-
std: '/assets/dynamsoft-capture-vision-std/',
31-
dip: '/assets/dynamsoft-image-processing/',
32-
core: '/assets/dynamsoft-core/',
33-
license: '/assets/dynamsoft-license/',
34-
cvr: '/assets/dynamsoft-capture-vision-router/',
35-
dbr: '/assets/dynamsoft-barcode-reader/',
36-
dce: '/assets/dynamsoft-camera-enhancer/',
37-
ddn: '/assets/dynamsoft-document-normalizer/',
38-
dlr: '/assets/dynamsoft-label-recognizer/',
39-
dcp: '/assets/dynamsoft-code-parser/',
40-
dnn: '/assets/dynamsoft-capture-vision-dnn/',
41-
dlrData: '/assets/dynamsoft-label-recognizer-data',
30+
std: 'assets/dynamsoft-capture-vision-std/',
31+
dip: 'assets/dynamsoft-image-processing/',
32+
core: 'assets/dynamsoft-core/',
33+
license: 'assets/dynamsoft-license/',
34+
cvr: 'assets/dynamsoft-capture-vision-router/',
35+
dbr: 'assets/dynamsoft-barcode-reader/',
36+
dce: 'assets/dynamsoft-camera-enhancer/',
37+
ddn: 'assets/dynamsoft-document-normalizer/',
38+
dlr: 'https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@3.2.30/dist/',
39+
dcp: 'https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.2.10/dist/',
40+
dnn: 'assets/dynamsoft-capture-vision-dnn/',
41+
dlrData: 'assets/dynamsoft-label-recognizer-data',
4242
};
4343

4444
try {

0 commit comments

Comments
 (0)