Skip to content

Commit

Permalink
Merge pull request #99 from BlinkID/feature/v4.5.0
Browse files Browse the repository at this point in the history
Feature/v4.5.0
  • Loading branch information
juraskrlec authored Dec 20, 2018
2 parents 0b02529 + 4b91cba commit 588c3f5
Show file tree
Hide file tree
Showing 68 changed files with 3,095 additions and 1,579 deletions.
11 changes: 8 additions & 3 deletions BlinkID/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export * from './recognizers/austriaIdBackRecognizer'
export * from './recognizers/austriaIdFrontRecognizer'
export * from './recognizers/austriaPassportRecognizer'
export * from './recognizers/barcodeRecognizer'
export * from './recognizers/bruneiIdFrontRecognizer'
export * from './recognizers/colombiaDlFrontRecognizer'
export * from './recognizers/colombiaIdBackRecognizer'
export * from './recognizers/colombiaIdFrontRecognizer'
Expand All @@ -132,6 +133,8 @@ export * from './recognizers/croatiaIdBackRecognizer'
export * from './recognizers/croatiaIdFrontRecognizer'
export * from './recognizers/cyprusIdBackRecognizer'
export * from './recognizers/cyprusIdFrontRecognizer'
export * from './recognizers/cyprusOldIdBackRecognizer'
export * from './recognizers/cyprusOldIdFrontRecognizer'
export * from './recognizers/czechiaCombinedRecognizer'
export * from './recognizers/czechiaIdBackRecognizer'
export * from './recognizers/czechiaIdFrontRecognizer'
Expand All @@ -148,7 +151,6 @@ export * from './recognizers/germanyIdFrontRecognizer'
export * from './recognizers/germanyOldIdRecognizer'
export * from './recognizers/germanyPassportRecognizer'
export * from './recognizers/hongKongIdFrontRecognizer'
export * from './recognizers/ikadRecognizer'
export * from './recognizers/indonesiaIdFrontRecognizer'
export * from './recognizers/irelandDlFrontRecognizer'
export * from './recognizers/italyDlFrontRecognizer'
Expand All @@ -158,14 +160,17 @@ export * from './recognizers/jordanIdFrontRecognizer'
export * from './recognizers/kuwaitIdBackRecognizer'
export * from './recognizers/kuwaitIdFrontRecognizer'
export * from './recognizers/malaysiaDlFrontRecognizer'
export * from './recognizers/malaysiaIkadFrontRecognizer'
export * from './recognizers/malaysiaMyKadBackRecognizer'
export * from './recognizers/malaysiaMyKadFrontRecognizer'
export * from './recognizers/malaysiaMyKasFrontRecognizer'
export * from './recognizers/malaysiaMyPrFrontRecognizer'
export * from './recognizers/malaysiaMyTenteraFrontRecognizer'
export * from './recognizers/mexicoVoterIdFrontRecognizer'
export * from './recognizers/moroccoIdBackRecognizer'
export * from './recognizers/moroccoIdFrontRecognizer'
export * from './recognizers/mrtdCombinedRecognizer'
export * from './recognizers/mrtdRecognizer'
export * from './recognizers/myKadBackRecognizer'
export * from './recognizers/myKadFrontRecognizer'
export * from './recognizers/newZealandDlFrontRecognizer'
export * from './recognizers/paymentCardBackRecognizer'
export * from './recognizers/paymentCardCombinedRecognizer'
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blinkid-react-native",
"version": "4.4.0",
"version": "4.5.0",
"description": "A small and powerful ID card scanning library. Powered by Microblink (www.microblink.com).",
"main": "index.js",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ import {
} from '../types'

/**
* Result object for MyKadFrontRecognizer.
* Result object for BruneiIdFrontRecognizer.
*/
export class MyKadFrontRecognizerResult extends RecognizerResult {
export class BruneiIdFrontRecognizerResult extends RecognizerResult {
constructor(nativeResult) {
super(nativeResult.resultState);

/**
* Owner army number on MyTentera documents
* The date of birth of Brunei ID owner.
*/
this.armyNumber = nativeResult.armyNumber;
this.dateOfBirth = nativeResult.dateOfBirth != null ? new Date(nativeResult.dateOfBirth) : null;

/**
* The document number of Brunei ID.
*/
this.documentNumber = nativeResult.documentNumber;

/**
* face image from the document if enabled with returnFaceImage property.
Expand All @@ -33,75 +38,72 @@ export class MyKadFrontRecognizerResult extends RecognizerResult {
this.fullDocumentImage = nativeResult.fullDocumentImage;

/**
* NRIC number (National Registration Identity Card Number)
*
* @see https://en.wikipedia.org/wiki/Malaysian_identity_card#Structure_of_the_National_Registration_Identity_Card_Number_.28NRIC.29
*/
this.nricNumber = nativeResult.nricNumber;

/**
* Owner address
* The full name of Brunei ID owner.
*/
this.ownerAddress = nativeResult.ownerAddress;
this.fullName = nativeResult.fullName;

/**
* Owner address city. Determined from owner address.
* The place of birth of Brunei ID owner.
*/
this.ownerAddressCity = nativeResult.ownerAddressCity;
this.placeOfBirth = nativeResult.placeOfBirth;

/**
* Owner address state. Determined from owner address.
* The sex of Brunei ID owner.
*/
this.ownerAddressState = nativeResult.ownerAddressState;
this.sex = nativeResult.sex;

/**
* Owner street. Determined from owner address.
*/
this.ownerAddressStreet = nativeResult.ownerAddressStreet;
}
}

/**
* Recognizer which can scan front side of yellow version of Brunei ID.
*/
export class BruneiIdFrontRecognizer extends Recognizer {
constructor() {
super('BruneiIdFrontRecognizer');

/**
* Owner address Zip code. Determined from owner address.
* Defines if glare detection should be turned on/off.
*
*
*/
this.ownerAddressZipCode = nativeResult.ownerAddressZipCode;
this.detectGlare = true;

/**
* Owner birth date converted in NSDate object
* Defines if date of birth of Brunei ID owner should be extracted.
*
*
*/
this.ownerBirthDate = nativeResult.ownerBirthDate != null ? new Date(nativeResult.ownerBirthDate) : null;
this.extractDateOfBirth = true;

/**
* Owner full name
* Defines if full name of Brunei ID owner should be extracted.
*
*
*/
this.ownerFullName = nativeResult.ownerFullName;
this.extractFullName = true;

/**
* Owner religion if written on MyKad
* Defines if place of birth of Brunei ID owner should be extracted.
*
*
*/
this.ownerReligion = nativeResult.ownerReligion;
this.extractPlaceOfBirth = true;

/**
* Owner sex (M for male, F for female)
* Defines if sex of Brunei ID owner should be extracted.
*
*
*/
this.ownerSex = nativeResult.ownerSex;

}
}

/**
* Class for configuring My Kad Front Recognizer.
*
* My Kad Front recognizer is used for scanning front side of My Kad.
*/
export class MyKadFrontRecognizer extends Recognizer {
constructor() {
super('MyKadFrontRecognizer');
this.extractSex = true;

/**
* Defines if army number should be extracted from MyTentera documents with MyKadRecognizer
* Property for setting DPI for face images
* Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
*
*
*/
this.extractArmyNumber = false;
this.faceImageDpi = 250;

/**
* Property for setting DPI for full document images
Expand All @@ -111,6 +113,14 @@ export class MyKadFrontRecognizer extends Recognizer {
*/
this.fullDocumentImageDpi = 250;

/**
* Image extension factors for full document image.
*
* @see ImageExtensionFactors
*
*/
this.fullDocumentImageExtensionFactors = new ImageExtensionFactors();

/**
* Sets whether face image from ID card should be extracted
*
Expand All @@ -125,6 +135,6 @@ export class MyKadFrontRecognizer extends Recognizer {
*/
this.returnFullDocumentImage = false;

this.createResultFromNative = function (nativeResult) { return new MyKadFrontRecognizerResult(nativeResult); }
this.createResultFromNative = function (nativeResult) { return new BruneiIdFrontRecognizerResult(nativeResult); }
}
}
30 changes: 3 additions & 27 deletions BlinkID/recognizers/cyprusIdBackRecognizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,21 @@ export class CyprusIdBackRecognizerResult extends RecognizerResult {
constructor(nativeResult) {
super(nativeResult.resultState);

/**
* The date Of Birth of the back side of the Cyprus Id owner.
*/
this.dateOfBirth = nativeResult.dateOfBirth != null ? new Date(nativeResult.dateOfBirth) : null;

/**
* The expiry date of Cyprus ID card.
*/
this.expiresOn = nativeResult.expiresOn != null ? new Date(nativeResult.expiresOn) : null;

/**
* full document image if enabled with returnFullDocumentImage property.
*/
this.fullDocumentImage = nativeResult.fullDocumentImage;

/**
* The sex of the back side of the Cyprus Id owner.
* The data extracted from the machine readable zone.
*/
this.sex = nativeResult.sex;
this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null;

}
}

/**
* Recognizer which can scan back side of Cyprus national ID cards.
* Recognizer which can scan back side of Cyprus ID cards.
*/
export class CyprusIdBackRecognizer extends Recognizer {
constructor() {
Expand All @@ -54,20 +44,6 @@ export class CyprusIdBackRecognizer extends Recognizer {
*/
this.detectGlare = true;

/**
* Defines if the expiry date of Cryprus ID card should be extracted.
*
*
*/
this.extractExpiresOn = true;

/**
* Defines if sex of Cyprus ID card owner should be extracted.
*
*
*/
this.extractSex = true;

/**
* Property for setting DPI for full document images
* Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
Expand Down
52 changes: 18 additions & 34 deletions BlinkID/recognizers/cyprusIdFrontRecognizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export class CyprusIdFrontRecognizerResult extends RecognizerResult {
constructor(nativeResult) {
super(nativeResult.resultState);

/**
* The document Number of the front side of the Cyprus Id owner.
*/
this.documentNumber = nativeResult.documentNumber;

/**
* face image from the document if enabled with returnFaceImage property.
*/
Expand All @@ -33,19 +28,14 @@ export class CyprusIdFrontRecognizerResult extends RecognizerResult {
this.fullDocumentImage = nativeResult.fullDocumentImage;

/**
* The id Number of the front side of the Cyprus Id owner.
* The ID number of Cyprus ID card.
*/
this.idNumber = nativeResult.idNumber;

/**
* The name of the front side of the Cyprus Id owner.
*/
this.name = nativeResult.name;

/**
* The surname of the front side of the Cyprus Id owner.
* image of the signature if enabled with returnSignatureImage property.
*/
this.surname = nativeResult.surname;
this.signatureImage = nativeResult.signatureImage;

}
}
Expand All @@ -64,27 +54,6 @@ export class CyprusIdFrontRecognizer extends Recognizer {
*/
this.detectGlare = true;

/**
* Defines if document number of Cyprus ID card should be extracted.
*
*
*/
this.extractDocumentNumber = true;

/**
* Defines if name of Cyprus ID card owner should be extracted.
*
*
*/
this.extractName = true;

/**
* Defines if surname of Cyprus ID card owner should be extracted.
*
*
*/
this.extractSurname = true;

/**
* Property for setting DPI for face images
* Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
Expand Down Expand Up @@ -123,6 +92,21 @@ export class CyprusIdFrontRecognizer extends Recognizer {
*/
this.returnFullDocumentImage = false;

/**
* Sets whether signature image from ID card should be extracted.
*
*
*/
this.returnSignatureImage = false;

/**
* Property for setting DPI for signature images
* Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
*
*
*/
this.signatureImageDpi = 250;

this.createResultFromNative = function (nativeResult) { return new CyprusIdFrontRecognizerResult(nativeResult); }
}
}
Loading

0 comments on commit 588c3f5

Please sign in to comment.