Skip to content

Commit

Permalink
Merge pull request #164 from BlinkID/release/6.4
Browse files Browse the repository at this point in the history
Release/6.4
  • Loading branch information
mparadina authored Dec 21, 2023
2 parents ec0f32d + c407afd commit f1500b1
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 30 deletions.
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-cordova",
"version": "6.3.1",
"version": "6.4.0",
"description": "A small and powerful ID card scanning library",
"cordova": {
"id": "blinkid-cordova",
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="blinkid-cordova"
version="6.3.1">
version="6.4.0">

<name>BlinkIdScanner</name>
<description>A small and powerful ID card scanning library</description>
Expand Down
15 changes: 11 additions & 4 deletions BlinkID/scripts/initIOSFramework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")"
pushd "${HERE}/../src/ios/" > /dev/null

LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.3.0/BlinkID.xcframework.zip'
LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.4.0/BlinkID.xcframework.zip'
FILENAME='BlinkID.xcframework.zip'

# check if BlinkID framework and bundle already exist
wget --version > /dev/null 2>&1 || { echo "ERROR: couldn't download BlinkID framework, install wget" && exit 1; }
wget -O "${FILENAME}" "${LINK}" -nv --show-progress || ( echo "ERROR: couldn't download BlinkID framework, Something went wrong while downloading framework from ${LINK}" && exit 1 )
# BlinkID framework will be obtained via wget or curl
if which wget >/dev/null ; then
echo "Downloading BlinkID framework via wget:"
wget -O "${FILENAME}" "${LINK}" -nv --show-progress || ( echo "ERROR: couldn't download BlinkID framework, something went wrong while downloading framework from ${LINK}" && exit 1 )
elif which curl >/dev/null ; then
echo "Downloading BlinkID framework via curl:"
curl -o "${FILENAME}" -L "${LINK}" --progress-bar --show-error || ( echo "ERROR: couldn't download BlinkID framework, something went wrong while downloading framework from ${LINK}" && exit 1 )
else
echo "Couldn't download BlinkID framework, neither wget nor curl is available."
fi

if [ -d 'BlinkID.bundle' ] ; then
rm -rf BlinkID.bundle && echo "Removing BlinkID.bundle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.microblink.blinkid.entities.recognizers.blinkid.generic.classinfo.Region;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.classinfo.Type;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.AlphabetType;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.Side;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.imageanalysis.CardRotation;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -120,6 +122,7 @@ public static JSONObject serializeImageAnalysisResult(ImageAnalysisResult imageA
jsonImageAnalysis.put("faceDetectionStatus", SerializationUtils.serializeEnum(imageAnalysisResult.getFaceDetectionStatus()));
jsonImageAnalysis.put("mrzDetectionStatus", SerializationUtils.serializeEnum(imageAnalysisResult.getMrzDetectionStatus()));
jsonImageAnalysis.put("barcodeDetectionStatus", SerializationUtils.serializeEnum(imageAnalysisResult.getBarcodeDetectionStatus()));
jsonImageAnalysis.put("cardRotation", BlinkIDSerializationUtils.serializeCardRotation(imageAnalysisResult.getCardRotation()));
return jsonImageAnalysis;
}

Expand Down Expand Up @@ -274,15 +277,9 @@ public static JSONObject serializeStringResult(StringResult stringResult) throws
jsonStringResult.put("location", jsonFieldLocations);

JSONObject jsonDocumentSides = new JSONObject();
if (stringResult.side(AlphabetType.Latin) != null) {
jsonDocumentSides.put("latin",stringResult.side(AlphabetType.Latin).ordinal());
}
if (stringResult.side(AlphabetType.Arabic) != null) {
jsonDocumentSides.put("arabic",stringResult.side(AlphabetType.Arabic).ordinal());
}
if (stringResult.side(AlphabetType.Cyrillic) != null) {
jsonDocumentSides.put("cyrillic",stringResult.side(AlphabetType.Cyrillic).ordinal());
}
jsonDocumentSides.put("latin",serializeSide(stringResult.side(AlphabetType.Latin)));
jsonDocumentSides.put("arabic",serializeSide(stringResult.side(AlphabetType.Arabic)));
jsonDocumentSides.put("cyrillic",serializeSide(stringResult.side(AlphabetType.Cyrillic)));
jsonStringResult.put("side", jsonDocumentSides);
}
return jsonStringResult;
Expand All @@ -308,6 +305,20 @@ public static JSONObject serializeAdditionalProcessingInfo(AdditionalProcessingI
return jsonAdditionalProcessingInfo;
}

public static int serializeSide(Side side) {
if (side != null) {
return side.ordinal() + 1;
}
return 0;
}

public static int serializeCardRotation(CardRotation rotation) {
if (rotation != null) {
return rotation.ordinal();
}
return 4;
}

public static ClassAnonymizationSettings[] deserializeClassAnonymizationSettings (JSONArray jsonArray) {

if (jsonArray != null && jsonArray.length() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("expired", result.isExpired());
jsonResult.put("faceImage", SerializationUtils.encodeImageBase64(result.getFaceImage()));
jsonResult.put("faceImageLocation", SerializationUtils.serializeRectangle(result.getFaceImageLocation()));
if (result.getFaceImageSide() != null) {
jsonResult.put("faceImageSide", SerializationUtils.serializeEnum(result.getFaceImageSide()));
}
jsonResult.put("faceImageSide", BlinkIDSerializationUtils.serializeSide(result.getFaceImageSide()));
jsonResult.put("fathersName", BlinkIDSerializationUtils.serializeStringResult(result.getFathersName()));
jsonResult.put("firstName", BlinkIDSerializationUtils.serializeStringResult(result.getFirstName()));
jsonResult.put("frontAdditionalProcessingInfo", BlinkIDSerializationUtils.serializeAdditionalProcessingInfo(result.getFrontAdditionalProcessingInfo()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("expired", result.isExpired());
jsonResult.put("faceImage", SerializationUtils.encodeImageBase64(result.getFaceImage()));
jsonResult.put("faceImageLocation", SerializationUtils.serializeRectangle(result.getFaceImageLocation()));
if (result.getFaceImageSide() != null) {
jsonResult.put("faceImageSide", SerializationUtils.serializeEnum(result.getFaceImageSide()));
}
jsonResult.put("faceImageSide", BlinkIDSerializationUtils.serializeSide(result.getFaceImageSide()));
jsonResult.put("fathersName", BlinkIDSerializationUtils.serializeStringResult(result.getFathersName()));
jsonResult.put("firstName", BlinkIDSerializationUtils.serializeStringResult(result.getFirstName()));
jsonResult.put("fullDocumentImage", SerializationUtils.encodeImageBase64(result.getFullDocumentImage()));
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/android/libBlinkID.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {
}

dependencies {
implementation('com.microblink:blinkid:6.3.0@aar') {
implementation('com.microblink:blinkid:6.4.0@aar') {
transitive = true
}
}
Expand Down
3 changes: 2 additions & 1 deletion BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ +(NSDictionary *) serializeImageAnalysisResult:(MBImageAnalysisResult *)imageAna
@"documentImageMoireStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.documentImageMoireStatus)],
@"faceDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.faceDetectionStatus)],
@"mrzDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.mrzDetectionStatus)],
@"barcodeDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.barcodeDetectionStatus)]
@"barcodeDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.barcodeDetectionStatus)],
@"cardRotation" : [NSNumber numberWithInteger:(imageAnalysisResult.cardRotation)]
};
}

Expand Down
6 changes: 3 additions & 3 deletions BlinkID/src/ios/sources/MBSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ + (NSDictionary *)serializeMBStringResult:(MBStringResult *) value {
[dict setValue:location forKey:@"location"];

NSMutableDictionary *side = [NSMutableDictionary dictionary];
[side setValue:[MBSerializationUtils serializeMBSide:[value sideForAlphabetType:MBAlphabetTypeLatin]] forKey:@"latin"];
[side setValue:[MBSerializationUtils serializeMBSide:[value sideForAlphabetType:MBAlphabetTypeLatin]] forKey:@"arabic"];
[side setValue:[MBSerializationUtils serializeMBSide:[value sideForAlphabetType:MBAlphabetTypeLatin]] forKey:@"cyrillic"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeLatin]] forKey:@"latin"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeArabic]] forKey:@"arabic"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeCyrillic]] forKey:@"cyrillic"];
[dict setValue:side forKey:@"side"];

return dict;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,11 @@ -(MBOverlayViewController *) createOverlayViewController:(NSDictionary *)jsonOve
{
id onboardingButtonTooltipDelay = [jsonOverlaySettings valueForKey:@"onboardingButtonTooltipDelay"];
if (onboardingButtonTooltipDelay != nil) {
sett.onboardingButtonTooltipDelay = [onboardingButtonTooltipDelay doubleValue] / 10000.0;
sett.onboardingButtonTooltipDelay = [onboardingButtonTooltipDelay doubleValue] / 1000.0;
}
}

{

id showMandatoryFieldsMissing = [jsonOverlaySettings valueForKey: @"showMandatoryFieldsMissing"];
if (showMandatoryFieldsMissing != nil) {
sett.defineSpecificMissingMandatoryFields = [showMandatoryFieldsMissing boolValue];
Expand Down
34 changes: 34 additions & 0 deletions BlinkID/www/blinkIdScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,28 @@ BlinkID.prototype.RecognitionMode = Object.freeze(
}
);

/**
* Defines possible document card rotation positions
*/
BlinkID.prototype.CardRotation = Object.freeze(
{
/** Zero degrees */
Zero: 0,

/** Clockwise 90 degrees */
Clockwise90: 1,

/** Counter clockwise 90 degrees */
CounterClockwise90: 2,

/** Upside down */
UpsideDown: 3,

/** Card rotation was not performed */
None: 4
}
);

/**
* Defines possible color and moire statuses determined from scanned image.
*/
Expand All @@ -405,6 +427,8 @@ function ImageAnalysisResult(nativeImageAnalysisResult) {
this.barcodeDetectionStatus = nativeImageAnalysisResult.barcodeDetectionStatus;
/** Orientation determined from the scanned image. */
this.cardOrientation = nativeImageAnalysisResult.cardOrientation;
/** Document card rotation positions */
this.cardRotation = nativeImageAnalysisResult.cardRotation;
}

/**
Expand Down Expand Up @@ -830,6 +854,14 @@ BlinkID.prototype.Region = Object.freeze(
NorthwestTerritories: 121,
Nunavut: 122,
PrinceEdwardIsland: 123,
DistritoFederal: 124,
Maranhao: 125,
MatoGrosso: 126,
MinasGerais: 127,
Para: 128,
Parana: 129,
Pernambuco: 130,
SantaCatarina: 131,
}
);

Expand Down Expand Up @@ -898,6 +930,8 @@ BlinkID.prototype.Type = Object.freeze(
SpecialId: 57,
UniformedServicesId: 58,
ImmigrantVisa: 59,
ConsularVoterId: 60,
TwicCard: 61,
}
);

Expand Down
3 changes: 3 additions & 0 deletions Release notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 6.4.0
- Updated to [Android SDK v6.4.0](https://github.com/BlinkID/blinkid-android/releases/tag/v6.4.0) and [iOS SDK v6.4.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.4.0)

## 6.3.0
- Updated to [Android SDK v6.3.0](https://github.com/BlinkID/blinkid-android/releases/tag/v6.3.0) and [iOS SDK v6.3.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.3.0)

Expand Down
4 changes: 2 additions & 2 deletions sample_files/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ var app = {

// package name/bundleID com.microblink.sample
var licenseKeys = {
android: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZE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1RJc0lrTnlaV0YwWldSR2IzSWlPaUkwT1RabFpEQXpaUzAwT0RBeExUUXpZV1F0WVRrMU5DMDBNemMyWlRObU9UTTVNR1FpZlE9PYPwAuE88FDjP95RyiGUewj+e6SGUoHitmTt0i2T87nVbH79ynAtPdmuQV49+U4ulln6j4ku3momxVE2igI9howeOZwxK5IbpMVG3ooDibChEXUccclpCCv08w3gEUwsP7hGOIBbA4HP45vru2nkan74SUYXWVU='
};

function buildResult(result, key) {
Expand Down

0 comments on commit f1500b1

Please sign in to comment.