Skip to content

Commit d055249

Browse files
author
Jenkins
committed
9.5.1256
1 parent 966a447 commit d055249

20 files changed

Lines changed: 110 additions & 100 deletions

File tree

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ android {
2828
}
2929

3030
dependencies {
31-
implementation('com.regula.documentreader:api:9.4.12820') {
31+
implementation('com.regula.documentreader:api:9.5.12960') {
3232
transitive = true
3333
}
3434

android/src/main/kotlin/com/regula/plugin/documentreader/Config.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fun setFunctionality(config: Functionality, input: JSONObject) = input.forEach {
5151
"manualMultipageMode" -> editor.setManualMultipageMode(v as Boolean)
5252
"torchTurnedOn" -> editor.setTorchTurnedOn(v as Boolean)
5353
"preventScreenRecording" -> editor.setPreventScreenRecording(v as Boolean)
54+
"hideStatusBar" -> editor.setHideStatusBar(v as Boolean)
5455
"showCaptureButtonDelayFromDetect" -> editor.setShowCaptureButtonDelayFromDetect(v.toLong())
5556
"showCaptureButtonDelayFromStart" -> editor.setShowCaptureButtonDelayFromStart(v.toLong())
5657
"orientation" -> editor.setOrientation(v.toInt())
@@ -88,6 +89,7 @@ fun getFunctionality(input: Functionality) = mapOf(
8889
"manualMultipageMode" to input.isManualMultipageMode,
8990
"torchTurnedOn" to input.isTorchTurnedOn,
9091
"preventScreenRecording" to input.doPreventScreenRecording(),
92+
"hideStatusBar" to input.doHideStatusBar(),
9193
"showCaptureButtonDelayFromDetect" to input.showCaptureButtonDelayFromDetect,
9294
"showCaptureButtonDelayFromStart" to input.showCaptureButtonDelayFromStart,
9395
"orientation" to input.orientation,
@@ -129,7 +131,6 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
129131
"updateOCRValidityByGlare" -> processParams.updateOCRValidityByGlare = v as Boolean
130132
"noGraphics" -> processParams.noGraphics = v as Boolean
131133
"multiDocOnImage" -> processParams.multiDocOnImage = v as Boolean
132-
"forceReadMrzBeforeLocate" -> processParams.forceReadMrzBeforeLocate = v as Boolean
133134
"parseBarcodes" -> processParams.parseBarcodes = v as Boolean
134135
"shouldReturnPackageForReprocess" -> processParams.shouldReturnPackageForReprocess = v as Boolean
135136
"disablePerforationOCR" -> processParams.disablePerforationOCR = v as Boolean
@@ -153,6 +154,7 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
153154
"strictExpiryDate" -> processParams.strictExpiryDate = v as Boolean
154155
"debugSaveBinarySession" -> processParams.debugSaveBinarySession = v as Boolean
155156
"checkVDS" -> processParams.checkVDS = v as Boolean
157+
"strictAgeCheck" -> processParams.strictAgeCheck = v as Boolean
156158
"measureSystem" -> processParams.measureSystem = v.toInt()
157159
"barcodeParserType" -> processParams.barcodeParserType = v.toInt()
158160
"perspectiveAngle" -> processParams.perspectiveAngle = v.toInt()
@@ -222,7 +224,6 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
222224
"updateOCRValidityByGlare" to processParams.updateOCRValidityByGlare,
223225
"noGraphics" to processParams.noGraphics,
224226
"multiDocOnImage" to processParams.multiDocOnImage,
225-
"forceReadMrzBeforeLocate" to processParams.forceReadMrzBeforeLocate,
226227
"parseBarcodes" to processParams.parseBarcodes,
227228
"shouldReturnPackageForReprocess" to processParams.shouldReturnPackageForReprocess,
228229
"disablePerforationOCR" to processParams.disablePerforationOCR,
@@ -246,6 +247,7 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
246247
"strictExpiryDate" to processParams.strictExpiryDate,
247248
"debugSaveBinarySession" to processParams.debugSaveBinarySession,
248249
"checkVDS" to processParams.checkVDS,
250+
"strictAgeCheck" to processParams.strictAgeCheck,
249251
"measureSystem" to processParams.measureSystem,
250252
"barcodeParserType" to processParams.barcodeParserType,
251253
"perspectiveAngle" to processParams.perspectiveAngle,
@@ -753,6 +755,7 @@ fun setLivenessParams(input: LivenessParams, opts: JSONObject) = opts.forEach {
753755
"checkBlackAndWhiteCopy" -> input.checkBlackAndWhiteCopy = v as Boolean
754756
"checkDynaprint" -> input.checkDynaprint = v as Boolean
755757
"checkGeometry" -> input.checkGeometry = v as Boolean
758+
"checkBarcodeBackground" -> input.checkBarcodeBackground = v as Boolean
756759
}
757760
}
758761

@@ -765,6 +768,7 @@ fun getLivenessParams(input: LivenessParams?) = input?.let {
765768
"checkBlackAndWhiteCopy" to input.checkBlackAndWhiteCopy,
766769
"checkDynaprint" to input.checkDynaprint,
767770
"checkGeometry" to input.checkGeometry,
771+
"checkBarcodeBackground" to input.checkBarcodeBackground,
768772
).toJson()
769773
}
770774

android/src/main/kotlin/com/regula/plugin/documentreader/JSONConstructor.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ fun recognizeConfigFromJSON(input: JSONObject) = input.let {
273273
for (i in images.indices) images[i] = base64Images.getString(i).toBitmap()
274274
builder.setBitmaps(images)
275275
}
276+
if (it.has("dataList")) {
277+
val array = it.getJSONArray("dataList")
278+
val dataList = mutableListOf<ByteArray>()
279+
for (i in 0..< array.length()) dataList.add(array.getString(i).toByteArray()!!)
280+
builder.setData(dataList)
281+
}
276282
if (it.has("imageInputData")) {
277283
val base64InputData = it.getJSONArray("imageInputData")
278284
val inputData = arrayOfNulls<ImageInputData>(base64InputData.length())
@@ -291,14 +297,8 @@ fun generateRecognizeConfig(input: RecognizeConfig?) = input?.let {
291297
"livePortrait" to it.livePortrait.toBase64(),
292298
"extPortrait" to it.extPortrait.toBase64(),
293299
"image" to it.bitmap.toBase64(),
294-
"data" to it.data.toBase64(),
295-
"images" to
296-
if (it.bitmaps == null) null
297-
else {
298-
val array = JSONArray()
299-
for (bitmap in it.bitmaps!!) array.put(bitmap.toBase64())
300-
array
301-
},
300+
"images" to it.bitmaps?.map { bp -> bp.toBase64() }?.toJson(),
301+
"dataList" to it.data?.map { bp -> bp.toBase64() }?.toJson(),
302302
"imageInputData" to it.imageInputData.toJson(::generateImageInputData)
303303
).toJson()
304304
}

android/src/test/kotlin/com/regula/plugin/documentreader/FlutterDocumentReaderApiPlugin.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ class FlutterDocumentReaderApiPluginTest {
3333
fun imageInputData() = compare("imageInputData", ::imageInputDataFromJSON, ::generateImageInputData)
3434

3535
@Test
36-
fun recognizeConfig() = compare("recognizeConfig", ::recognizeConfigFromJSON, ::generateRecognizeConfig)
36+
fun recognizeConfig() = compare(
37+
"recognizeConfig", ::recognizeConfigFromJSON, ::generateRecognizeConfig,
38+
"data"
39+
)
3740

3841
@Test
3942
fun recognizeConfig2() = compare(
4043
"recognizeConfig2", ::recognizeConfigFromJSON, ::generateRecognizeConfig,
41-
"onlineProcessingConfig.requestHeaders"
44+
"onlineProcessingConfig.requestHeaders",
45+
"data"
4246
)
4347

4448
@Test

example/ios/Tests/Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class Tests: XCTestCase {
169169
"videoRecordingSizeDownscaleFactor",
170170
"excludedCamera2Models",
171171
"cameraSize",
172+
"hideStatusBar",
172173
"cameraMode"])
173174
}
174175

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
sdk: flutter
1515
flutter_document_reader_api:
1616
path: ../
17-
flutter_document_reader_core_fullauthrfid: 9.4.2203
17+
flutter_document_reader_core_fullauthrfid: 9.5.2465
1818
flutter_document_reader_btdevice: 9.4.46
1919
cupertino_icons: ^1.0.8
2020

ios/Classes/RGLWConfig.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ +(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams
163163
processParams.noGraphics = [options valueForKey:@"noGraphics"];
164164
if([options valueForKey:@"multiDocOnImage"] != nil)
165165
processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
166-
if([options valueForKey:@"forceReadMrzBeforeLocate"] != nil)
167-
processParams.forceReadMrzBeforeLocate = [options valueForKey:@"forceReadMrzBeforeLocate"];
168166
if([options valueForKey:@"parseBarcodes"] != nil)
169167
processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
170168
if([options valueForKey:@"shouldReturnPackageForReprocess"] != nil)
@@ -197,6 +195,7 @@ +(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams
197195
if (options[@"strictExpiryDate"]) processParams.strictExpiryDate = options[@"strictExpiryDate"];
198196
if (options[@"debugSaveBinarySession"]) processParams.debugSaveBinarySession = options[@"debugSaveBinarySession"];
199197
if (options[@"checkVDS"]) processParams.checkVDS = options[@"checkVDS"];
198+
if (options[@"strictAgeCheck"]) processParams.strictAgeCheck = options[@"strictAgeCheck"];
200199

201200
// Int
202201
if([options valueForKey:@"measureSystem"] != nil)
@@ -308,7 +307,6 @@ +(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
308307
result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
309308
result[@"noGraphics"] = processParams.noGraphics;
310309
result[@"multiDocOnImage"] = processParams.multiDocOnImage;
311-
result[@"forceReadMrzBeforeLocate"] = processParams.forceReadMrzBeforeLocate;
312310
result[@"parseBarcodes"] = processParams.parseBarcodes;
313311
result[@"shouldReturnPackageForReprocess"] = processParams.shouldReturnPackageForReprocess;
314312
result[@"disablePerforationOCR"] = processParams.disablePerforationOCR;
@@ -332,6 +330,7 @@ +(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
332330
result[@"strictExpiryDate"] = processParams.strictExpiryDate;
333331
result[@"debugSaveBinarySession"] = processParams.debugSaveBinarySession;
334332
result[@"checkVDS"] = processParams.checkVDS;
333+
result[@"strictAgeCheck"] = processParams.strictAgeCheck;
335334

336335
// Int
337336
result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
@@ -1065,6 +1064,7 @@ +(void)setLivenessParams:(RGLLivenessParams*)result input:(NSDictionary*)input {
10651064
if(input[@"checkBlackAndWhiteCopy"]) result.checkBlackAndWhiteCopy = input[@"checkBlackAndWhiteCopy"];
10661065
if(input[@"checkDynaprint"]) result.checkDynaprint = input[@"checkDynaprint"];
10671066
if(input[@"checkGeometry"]) result.checkGeometry = input[@"checkGeometry"];
1067+
if(input[@"checkBarcodeBackground"]) result.checkBarcodeBackground = input[@"checkBarcodeBackground"];
10681068
}
10691069

10701070
+(NSDictionary*)getLivenessParams:(RGLLivenessParams*)input {
@@ -1078,6 +1078,7 @@ +(NSDictionary*)getLivenessParams:(RGLLivenessParams*)input {
10781078
result[@"checkBlackAndWhiteCopy"] = input.checkBlackAndWhiteCopy;
10791079
result[@"checkDynaprint"] = input.checkDynaprint;
10801080
result[@"checkGeometry"] = input.checkGeometry;
1081+
result[@"checkBarcodeBackground"] = input.checkBarcodeBackground;
10811082

10821083
return result;
10831084
}

ios/Classes/RGLWJSONConstructor.m

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,16 @@ +(RGLRecognizeConfig*)recognizeConfigFromJson:(NSDictionary*)input {
227227
if (input[@"image"]) config.image = [RGLWJSONConstructor imageWithBase64:input[@"image"]];
228228
if (input[@"data"]) config.imageData = [RGLWJSONConstructor base64Decode:input[@"data"]];
229229
if (input[@"images"]) {
230-
NSMutableArray<UIImage*>* images = [NSMutableArray new];
231-
for(NSString* base64 in input[@"images"])
232-
[images addObject:[RGLWJSONConstructor imageWithBase64:base64]];
233-
config.images = images;
230+
NSMutableArray<UIImage*>* list = [NSMutableArray new];
231+
for(NSString* item in input[@"images"])
232+
[list addObject:[RGLWJSONConstructor imageWithBase64:item]];
233+
config.images = list;
234+
}
235+
if (input[@"dataList"]) {
236+
NSMutableArray<NSData*>* list = [NSMutableArray new];
237+
for(NSString* item in input[@"dataList"])
238+
[list addObject:[RGLWJSONConstructor base64Decode:item]];
239+
config.imageDataArray = list;
234240
}
235241
if(input[@"imageInputData"]) {
236242
NSMutableArray<RGLImageInput*>* imageInputs = [NSMutableArray new];
@@ -261,10 +267,16 @@ +(NSDictionary*)generateRecognizeConfig:(RGLRecognizeConfig*)input {
261267
result[@"image"] = [self base64WithImage: input.image];
262268
result[@"data"] = [self base64Encode: input.imageData];
263269
if(input.images != nil) {
264-
NSMutableArray *array = [NSMutableArray new];
270+
NSMutableArray *list = [NSMutableArray new];
265271
for(UIImage* item in input.images)
266-
[array addObject:[self base64WithImage:item]];
267-
result[@"images"] = array;
272+
[list addObject:[self base64WithImage:item]];
273+
result[@"images"] = list;
274+
}
275+
if(input.imageDataArray != nil) {
276+
NSMutableArray *list = [NSMutableArray new];
277+
for(NSData* item in input.imageDataArray)
278+
[list addObject:[self base64Encode:item]];
279+
result[@"dataList"] = list;
268280
}
269281
if(input.imageInputs != nil) {
270282
NSMutableArray *array = [NSMutableArray new];

ios/flutter_document_reader_api.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'flutter_document_reader_api'
3-
s.version = '9.4.1152'
3+
s.version = '9.5.1256'
44
s.summary = 'A new flutter plugin project.'
55
s.description = <<-DESC
66
A new flutter plugin project.
@@ -13,7 +13,7 @@ A new flutter plugin project.
1313
s.public_header_files = 'Classes/**/*.h'
1414
s.dependency 'Flutter'
1515
s.platform = :ios, '13.0'
16-
s.dependency 'DocumentReader', '9.4.6317'
16+
s.dependency 'DocumentReader', '9.5.6464'
1717
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
1818
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
1919
end

lib/src/config/recognize_config.dart

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
//
2-
// RecognizeConfig.dart
3-
// DocumentReader
4-
//
5-
// Created by Pavel Masiuk on 21.09.2023.
6-
// Copyright © 2023 Regula. All rights reserved.
7-
//
8-
91
part of "../../flutter_document_reader_api.dart";
102

113
/// Image processing configuration.
@@ -29,6 +21,9 @@ class RecognizeConfig {
2921
/// Binary for processing.
3022
Uint8List? data;
3123

24+
/// Binaries for processing.
25+
List<Uint8List>? dataList;
26+
3227
/// Images(with input data) for processing.
3328
List<ImageInputData>? imageInputData;
3429

@@ -56,6 +51,7 @@ class RecognizeConfig {
5651
Uint8List? image,
5752
List<Uint8List>? images,
5853
Uint8List? data,
54+
List<Uint8List>? dataList,
5955
List<ImageInputData>? imageInputData,
6056
Uint8List? dtc,
6157
Uint8List? livePortrait,
@@ -69,6 +65,7 @@ class RecognizeConfig {
6965
image = image,
7066
images = images,
7167
data = data,
68+
dataList = dataList,
7269
imageInputData = imageInputData,
7370
dtc = dtc;
7471

@@ -77,6 +74,7 @@ class RecognizeConfig {
7774
Uint8List? image,
7875
List<Uint8List>? images,
7976
Uint8List? data,
77+
List<Uint8List>? dataList,
8078
List<ImageInputData>? imageInputData,
8179
Uint8List? dtc,
8280
Uint8List? livePortrait,
@@ -90,6 +88,7 @@ class RecognizeConfig {
9088
image = image,
9189
images = images,
9290
data = data,
91+
dataList = dataList,
9392
imageInputData = imageInputData,
9493
dtc = dtc;
9594

@@ -112,6 +111,12 @@ class RecognizeConfig {
112111
}
113112
}
114113
result.data = _bytesFromBase64(jsonObject["data"]);
114+
if (jsonObject["dataList"] != null) {
115+
result.dataList = [];
116+
for (var item in jsonObject["dataList"]) {
117+
result.dataList!.addSafe(_bytesFromBase64(item));
118+
}
119+
}
115120
if (jsonObject["imageInputData"] != null) {
116121
result.imageInputData = [];
117122
for (var item in jsonObject["imageInputData"]) {
@@ -133,6 +138,7 @@ class RecognizeConfig {
133138
"image": _bytesToBase64(image),
134139
"images": images?.map((e) => _bytesToBase64(e)).toList(),
135140
"data": _bytesToBase64(data),
141+
"dataList": dataList?.map((e) => _bytesToBase64(e)).toList(),
136142
"imageInputData": imageInputData?.map((e) => e.toJson()).toList(),
137143
"dtc": _bytesToBase64(dtc),
138144
"oneShotIdentification": oneShotIdentification,

0 commit comments

Comments
 (0)