Skip to content

Commit

Permalink
Merge pull request #26 from blinkcard/jenkins/stable-build
Browse files Browse the repository at this point in the history
Automatically built release by Jenkins
  • Loading branch information
mb-mpisacic authored Apr 2, 2024
2 parents 5f2c6a4 + 8dcc818 commit bf1373e
Show file tree
Hide file tree
Showing 88 changed files with 11,094 additions and 14,116 deletions.
104 changes: 52 additions & 52 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{
"root": true,
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json"]
},
"plugins": [ "@typescript-eslint" ],
"rules": {
"brace-style": ["error", "allman", { "allowSingleLine": true }],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always"],
"indent": ["error", 4, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"lines-between-class-members": ["error", "always"],
"max-len": ["error", { "code": 120 }],
"new-cap": "error",
"no-irregular-whitespace": ["off"],
"no-multiple-empty-lines": "error",
"no-nested-ternary": "error",
"no-trailing-spaces": "error",
"no-unexpected-multiline": ["off"],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"one-var": ["error", "never"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"space-before-blocks": ["error", "always"],
"space-in-parens": ["error", "always"],
"spaced-comment": ["error", "always", {
"block": { "balanced": true },
"exceptions": []
}],
"@typescript-eslint/no-empty-interface": ["error", { "allowSingleExtends": true }],
"@typescript-eslint/no-explicit-any": ["error"],
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-non-null-assertion": ["error"],
"@typescript-eslint/no-unsafe-assignment": ["error"],
"@typescript-eslint/no-unsafe-call": ["error"],
"@typescript-eslint/no-unsafe-member-access": ["error"],
"@typescript-eslint/no-unsafe-return": ["error"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/restrict-template-expressions": ["error"]
}
"root": true,
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json"]
},
"plugins": [ "@typescript-eslint" ],
"rules": {
"brace-style": ["error", "allman", { "allowSingleLine": true }],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always"],
"indent": ["error", 4, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"lines-between-class-members": ["error", "always"],
"max-len": ["error", { "code": 120 }],
"new-cap": "error",
"no-irregular-whitespace": ["off"],
"no-multiple-empty-lines": "error",
"no-nested-ternary": "error",
"no-trailing-spaces": "error",
"no-unexpected-multiline": ["off"],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"one-var": ["error", "never"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"space-before-blocks": ["error", "always"],
"space-in-parens": ["error", "always"],
"spaced-comment": ["error", "always", {
"block": { "balanced": true },
"exceptions": []
}],
"@typescript-eslint/no-empty-interface": ["error", { "allowSingleExtends": true }],
"@typescript-eslint/no-explicit-any": ["error"],
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-non-null-assertion": ["error"],
"@typescript-eslint/no-unsafe-assignment": ["error"],
"@typescript-eslint/no-unsafe-call": ["error"],
"@typescript-eslint/no-unsafe-member-access": ["error"],
"@typescript-eslint/no-unsafe-return": ["error"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/restrict-template-expressions": ["error"]
}
}
18 changes: 18 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Release notes

## 2.9.0

### Improvements
- Included hand, photocopy, and screen detection models to achieve liveness functionality
- Added anonymization info on which side was anonymized. String data is anonymized using an asterisk instead of blanking the result.
- Expanded the number of supported credit card types by 100%.
- Improved data extraction, including a 30% reduction in incorrect processing of CVV field.

### What's new in the BlinkCard Recognizer?
- Improved scanning performance and added support for virtually any card layout
- Improved IBAN parser which now supports more IBAN formats
- Added option `allowInvalidCardNumber` which allows reading invalid card numbers to avoid endless scanning on samples and test cards:
- use with care as it might reduce accuracy in certain situations in production
- for invalid card number the flag `cardNumberValid` in `BlinkCardRecognizer.Result` will be set to `false`
- Added new settings `handScaleThreshold`, `handDocumentOverlapThreshold`, `screenAnalysisMatchLevel`, `photocopyAnalysisMatchLevel`. These settings are used in combination with the new liveness features.
- Added a new callback `LivenessStatusCallback`, which is invoked when each side of a card is scanned. It is called with one parameter, a `LivenessStatus` enum. Use `BlinkCardRecognizer.setLivenessStatusCallback` method to set the callback.

### BlinkCard Recognizer Result
- Two new booleans: `firstSideAnonymized` and `secondSideAnonymized` have been added to indicate whether the first or second side of the card has been anonymized, respectively.
- New result `documentLivenessCheck` which has new liveness model results. It contains liveness information about the first and second sides of the card. Liveness information contains the results of checks performed on the card using screen detection, photocopy detection, and the presence of a live hand.

### Dynamic webassembly memory management

Depending on the device used, the SDK will allocate different amounts of memory on startup.
This is primarily used as a mitigation mechanism for iOS's memory management, which often blocks webassembly memory growth.

Although it's not recommended, this can be overridden using `WasmSDKLoadSettings.initialMemory`.

### Other fixes:
- Fixed an issue where certain iOS devices would display a zoomed in preview.
- Improved scanning of Bolivia IDs by addressing cases where the expiration date is covered by a signature, allowing the completion of the scanning process.

## 2.7.0

### Platform-related SDK changes
Expand Down
90 changes: 45 additions & 45 deletions examples/blinkcard-camera/javascript/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ function main()

// 1. It's possible to obtain a free trial license key on microblink.com
let licenseKey =
"sRwAAAYJbG9jYWxob3N0r/lOPmg/w35CpOHWLcIXyZqx58jBjDQEgc9g8PbxdaaDM+jedRKGXjqKQKz7ocX5/uQ6wvwfkHd4iovo1UDxWg4K+dstSEarVzTkBgKXX7iqpHoOjlU1pXPWbWBGasvjaoC2sKOnT7RozIdO8ljPeJVQO0owX3JzguXvoYK3p2ZtlcV/ndSC43hDJjKy4ACGg4Cul5jogfwPEdtJ7bk0XmtamIvtCVSnqQMfF1EwxCXOHw==";
"sRwAAAYJbG9jYWxob3N0r/lOPmg/w35CpOFWLtI6YVMagd7qe8/EOiQdBCHH7rBLyV3JjL+I2rJWV4BrxGEa2nbATYCMS4dXNT6m3lRq17cKuAZzawRDTd18iL4UX6cztXgS2Zc5/QThVwlGymJ0RMG0GxS2xLzhmb64PLPYmUUZ0xZ4/dijrsZIsiEVXQxySUrJ2qT9+GWabDj97AW+5zN0wZE2nT6bznsJkMW4qsMIgwvdWFud7u7tQfS2EqsGVQ==";

if (window.location.hostname === "blinkcard.github.io")
{
licenseKey =
"sRwAAAYTYmxpbmtjYXJkLmdpdGh1Yi5pby+N7zvpysD9Mbe+K36ZxH84iPO5UizTDjd3UMrotMVNG4OWJpwSC8vh+SYmFWkS5v+Biodkzoa6iMHgneLnPJxo1p3rcRal8VYRJuJoo98xSeGaZX90jyjXMsDBoBm3tor+67zWr3fO3Dgl7u921IwGGRmaLiEpdYQXgpZUZRHy3VQDP0khXQ9EaBy48GXsV2xBHuHcnneW/MWmtr/+jp15d/uHRQfsMitmnTYP69uX0iw=";
"sRwAAAYTYmxpbmtjYXJkLmdpdGh1Yi5pby+N7zvpysD9Mbe+q32J6dfaZEBXoOLTJ0MiK7rGSB127xE1rdTFeX+Y8B6EaRzBBU7wct6tV2z/2ygilvDSEpYexwwsCQYKrZoGbPE2pWEB6TQ1yWN7z00K7F0tOYaOF4VEmWKQ5UkPls4SHaSc0NWQQgl9f2/5gtsFSiGYvk6aBndDjdUqsqFzOOW7JawL8Q22a6DeraA7noTPdXCPm4fLt6EyftHn0ij5HhcMddji3tI=";
}

// 2. Create instance of SDK load settings with your license key
Expand All @@ -62,24 +62,24 @@ function main()

// 3. Load SDK
BlinkCardSDK.loadWasmModule(loadSettings).then(
(sdk) =>
{
document.getElementById("screen-initial")?.classList.add("hidden");
document.getElementById("screen-start")?.classList.remove("hidden");
document.
getElementById("start-scan")?.
addEventListener("click", (ev) =>
(sdk) =>
{
ev.preventDefault();
startScan(sdk);
});
},
(error) =>
{
initialMessageEl.innerText = "Failed to load SDK!";
console.error("Failed to load SDK!", error);
});

document.getElementById("screen-initial")?.classList.add("hidden");
document.getElementById("screen-start")?.classList.remove("hidden");
document.
getElementById("start-scan")?.
addEventListener("click", (ev) =>
{
ev.preventDefault();
startScan(sdk);
});
},
(error) =>
{
initialMessageEl.innerText = "Failed to load SDK!";
console.error("Failed to load SDK!", error);
}
);
}

/**
Expand All @@ -95,8 +95,8 @@ async function startScan(sdk)
// In this example, we create a BlinkCardRecognizer, which knows how to scan Payment cards
// and extract payment information from them.
const blinkCardRecognizer = await BlinkCardSDK.createBlinkCardRecognizer(
sdk);

sdk
);

// [OPTIONAL] Create a callbacks object that will receive recognition events, such as detected object location etc.
const callbacks = {
Expand All @@ -107,22 +107,22 @@ async function startScan(sdk)
// 2. Create a RecognizerRunner object which orchestrates the recognition with one or more
// recognizer objects.
const recognizerRunner = await BlinkCardSDK.createRecognizerRunner(
// SDK instance to use
sdk,
// List of recognizer objects that will be associated with created RecognizerRunner object
[blinkCardRecognizer],
// [OPTIONAL] Should recognition pipeline stop as soon as first recognizer in chain finished recognition
false,
// [OPTIONAL] Callbacks object that will receive recognition events
callbacks);

// SDK instance to use
sdk,
// List of recognizer objects that will be associated with created RecognizerRunner object
[blinkCardRecognizer],
// [OPTIONAL] Should recognition pipeline stop as soon as first recognizer in chain finished recognition
false,
// [OPTIONAL] Callbacks object that will receive recognition events
callbacks
);

// 3. Create a VideoRecognizer object and attach it to HTMLVideoElement that will be used for displaying the camera feed
const videoRecognizer =
await BlinkCardSDK.VideoRecognizer.createVideoRecognizerFromCameraStream(
cameraFeed,
recognizerRunner);

cameraFeed,
recognizerRunner
);

// 4. Start the recognition and await for the results
const processResult = await videoRecognizer.recognize();
Expand All @@ -145,8 +145,8 @@ async function startScan(sdk)
};

alert(
`Hello, ${firstAndLastName}!\n Your payment card with card number ${cardNumber} will expire on ${dateOfExpiry.year}/${dateOfExpiry.month}.`);

`Hello, ${firstAndLastName}!\n Your payment card with card number ${cardNumber} will expire on ${dateOfExpiry.year}/${dateOfExpiry.month}.`
);
}
} else

Expand Down Expand Up @@ -226,20 +226,20 @@ function applyTransform(transformMatrix)
drawContext.translate(xOffset, yOffset);
// second, scale the canvas to fit the scaled video
drawContext.scale(
scaledVideoWidth / cameraFeed.videoWidth,
scaledVideoHeight / cameraFeed.videoHeight);

scaledVideoWidth / cameraFeed.videoWidth,
scaledVideoHeight / cameraFeed.videoHeight
);

// finally, apply transformation from image coordinate system to
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform
drawContext.transform(
transformMatrix[0],
transformMatrix[3],
transformMatrix[1],
transformMatrix[4],
transformMatrix[2],
transformMatrix[5]);

transformMatrix[0],
transformMatrix[3],
transformMatrix[1],
transformMatrix[4],
transformMatrix[2],
transformMatrix[5]
);
}

function clearDrawCanvas()
Expand Down
2 changes: 1 addition & 1 deletion examples/blinkcard-camera/javascript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ <h1 id="msg">Loading...</h1>
</body>

<!-- Keep in mind that the jsDelivr CDN is used for demonstration, it's not intended to be used in production! -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@microblink/blinkcard-in-browser-sdk@2.7.0/dist/blinkcard-sdk.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@microblink/blinkcard-in-browser-sdk@2.9.0/dist/blinkcard-sdk.js"></script>
<script type="text/javascript" src="app.js"></script>
</html>
2 changes: 1 addition & 1 deletion examples/blinkcard-camera/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"typescript": "^3.9.5"
},
"dependencies": {
"@microblink/blinkcard-in-browser-sdk": "~2.7.0"
"@microblink/blinkcard-in-browser-sdk": "~2.9.0"
}
}
2 changes: 1 addition & 1 deletion examples/blinkcard-camera/typescript/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main() {
}

// 1. It's possible to obtain a free trial license key on microblink.com
const licenseKey = "sRwAAAYJbG9jYWxob3N0r/lOPmg/w35CpOHWLcIXyZqx58jBjDQEgc9g8PbxdaaDM+jedRKGXjqKQKz7ocX5/uQ6wvwfkHd4iovo1UDxWg4K+dstSEarVzTkBgKXX7iqpHoOjlU1pXPWbWBGasvjaoC2sKOnT7RozIdO8ljPeJVQO0owX3JzguXvoYK3p2ZtlcV/ndSC43hDJjKy4ACGg4Cul5jogfwPEdtJ7bk0XmtamIvtCVSnqQMfF1EwxCXOHw==";
const licenseKey = "sRwAAAYJbG9jYWxob3N0r/lOPmg/w35CpOFWLtI6YVMagd7qe8/EOiQdBCHH7rBLyV3JjL+I2rJWV4BrxGEa2nbATYCMS4dXNT6m3lRq17cKuAZzawRDTd18iL4UX6cztXgS2Zc5/QThVwlGymJ0RMG0GxS2xLzhmb64PLPYmUUZ0xZ4/dijrsZIsiEVXQxySUrJ2qT9+GWabDj97AW+5zN0wZE2nT6bznsJkMW4qsMIgwvdWFud7u7tQfS2EqsGVQ==";

// 2. Create instance of SDK load settings with your license key
const loadSettings = new BlinkCardSDK.WasmSDKLoadSettings(licenseKey);
Expand Down
Loading

0 comments on commit bf1373e

Please sign in to comment.