@hexar/biometric-identity-sdk-core 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -82,7 +82,7 @@ export declare class BiometricIdentitySDK {
|
|
|
82
82
|
/**
|
|
83
83
|
* Compress base64 image - simplified version that works in all environments
|
|
84
84
|
* For React Native, images should be compressed at capture time
|
|
85
|
-
* This
|
|
85
|
+
* This reduces large images by skipping compression if already small enough
|
|
86
86
|
*/
|
|
87
87
|
private compressImage;
|
|
88
88
|
/**
|
|
@@ -299,7 +299,7 @@ class BiometricIdentitySDK {
|
|
|
299
299
|
minimumRequired: 10
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
|
-
const MAX_FRAMES =
|
|
302
|
+
const MAX_FRAMES = 15;
|
|
303
303
|
if (videoFrames.length > MAX_FRAMES) {
|
|
304
304
|
const step = Math.floor(videoFrames.length / MAX_FRAMES);
|
|
305
305
|
videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
|
|
@@ -419,13 +419,13 @@ class BiometricIdentitySDK {
|
|
|
419
419
|
/**
|
|
420
420
|
* Compress base64 image - simplified version that works in all environments
|
|
421
421
|
* For React Native, images should be compressed at capture time
|
|
422
|
-
* This
|
|
422
|
+
* This reduces large images by skipping compression if already small enough
|
|
423
423
|
*/
|
|
424
424
|
async compressImage(base64Image) {
|
|
425
425
|
if (!base64Image || base64Image.length === 0) {
|
|
426
426
|
return base64Image;
|
|
427
427
|
}
|
|
428
|
-
const MAX_SIZE =
|
|
428
|
+
const MAX_SIZE = 500 * 1024;
|
|
429
429
|
if (base64Image.length < MAX_SIZE) {
|
|
430
430
|
return base64Image;
|
|
431
431
|
}
|
|
@@ -438,6 +438,7 @@ class BiometricIdentitySDK {
|
|
|
438
438
|
catch (error) {
|
|
439
439
|
logger_1.logger.warn('Image compression not available, using original', error);
|
|
440
440
|
}
|
|
441
|
+
logger_1.logger.warn(`Image too large (${Math.round(base64Image.length / 1024)}KB) but compression not available`);
|
|
441
442
|
return base64Image;
|
|
442
443
|
}
|
|
443
444
|
/**
|
package/package.json
CHANGED
|
@@ -381,7 +381,7 @@ export class BiometricIdentitySDK {
|
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
const MAX_FRAMES =
|
|
384
|
+
const MAX_FRAMES = 15;
|
|
385
385
|
if (videoFrames.length > MAX_FRAMES) {
|
|
386
386
|
const step = Math.floor(videoFrames.length / MAX_FRAMES);
|
|
387
387
|
videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
|
|
@@ -524,14 +524,14 @@ export class BiometricIdentitySDK {
|
|
|
524
524
|
/**
|
|
525
525
|
* Compress base64 image - simplified version that works in all environments
|
|
526
526
|
* For React Native, images should be compressed at capture time
|
|
527
|
-
* This
|
|
527
|
+
* This reduces large images by skipping compression if already small enough
|
|
528
528
|
*/
|
|
529
529
|
private async compressImage(base64Image: string): Promise<string> {
|
|
530
530
|
if (!base64Image || base64Image.length === 0) {
|
|
531
531
|
return base64Image;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
const MAX_SIZE =
|
|
534
|
+
const MAX_SIZE = 500 * 1024;
|
|
535
535
|
if (base64Image.length < MAX_SIZE) {
|
|
536
536
|
return base64Image;
|
|
537
537
|
}
|
|
@@ -545,6 +545,7 @@ export class BiometricIdentitySDK {
|
|
|
545
545
|
logger.warn('Image compression not available, using original', error);
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
+
logger.warn(`Image too large (${Math.round(base64Image.length / 1024)}KB) but compression not available`);
|
|
548
549
|
return base64Image;
|
|
549
550
|
}
|
|
550
551
|
|
package/src/api/BackendClient.ts
CHANGED
|
@@ -141,7 +141,7 @@ export class BackendClient {
|
|
|
141
141
|
this.config = {
|
|
142
142
|
apiEndpoint: config.apiEndpoint.replace(/\/$/, ''),
|
|
143
143
|
apiKey: config.apiKey,
|
|
144
|
-
timeout: config.timeout ||
|
|
144
|
+
timeout: config.timeout || 120000,
|
|
145
145
|
};
|
|
146
146
|
this.sdkSessionId = this.generateSDKSessionId();
|
|
147
147
|
}
|