Skip to content

Commit 1ae864b

Browse files
committed
Bump
1 parent 86c0379 commit 1ae864b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@op-engineering/op-ocr",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "VisionCamera Frame Processor Plugin to detect and read MRZ data from passports using MLKit Text Recognition.",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/index.d.ts",

src/components/MRZScanner.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const MRZScanner: FC<
4848
* @param element
4949
*/
5050
const mrzQACheck = (list: string[], element: string) => {
51+
if (element === '') {
52+
return;
53+
}
54+
5155
for (let i = 0; i < list.length; i++) {
5256
if (list[i] !== element) {
5357
list = [];
@@ -64,7 +68,6 @@ const MRZScanner: FC<
6468
*/
6569
const currentMRZMatchesPreviousMRZs = (mrzResults: MRZProperties) => {
6670
if (
67-
// docMRZQAList.length >= nu &&
6871
idList.length >= numQAChecks &&
6972
dobList.length >= numQAChecks &&
7073
expiryList.length >= numQAChecks
@@ -79,6 +82,7 @@ const MRZScanner: FC<
7982
if (mrzResults.birthDate && dobList.length < numQAChecks) {
8083
mrzQACheck(dobList, mrzResults.birthDate);
8184
}
85+
8286
if (mrzResults.expiryDate && expiryList.length < numQAChecks) {
8387
mrzQACheck(expiryList, mrzResults.expiryDate);
8488
}
@@ -103,7 +107,6 @@ const MRZScanner: FC<
103107

104108
if (data.result.blocks.length > 0 && isActive) {
105109
const mrzResults = parseMRZ(data.result.blocks);
106-
// console.log(mrzResults);
107110
if (mrzResults && currentMRZMatchesPreviousMRZs(mrzResults)) {
108111
onResults(mrzResults);
109112
}
@@ -115,16 +118,13 @@ const MRZScanner: FC<
115118

116119
const handleScanFunc = useRunOnJS(handleScan, []);
117120

118-
/* Using the useFrameProcessor hook to process the video frames. */
119121
const frameProcessor = useFrameProcessor((frame) => {
120122
'worklet';
121123
const data = scanMRZ(frame);
122124

123125
if (!data) {
124126
return;
125127
}
126-
const lines = data.result.blocks.map((b) => b.text);
127-
console.log(`🟢 ${JSON.stringify(lines)}`);
128128

129129
handleScanFunc(data);
130130
}, []);

0 commit comments

Comments
 (0)