idmission-web-sdk 2.3.63 → 2.3.65

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.63';
214
+ var webSdkVersion = '2.3.65';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -8136,7 +8136,6 @@
8136
8136
  xMin = _b.xMin,
8137
8137
  width = _b.width;
8138
8138
  var desiredWidth = frame.height * 0.6;
8139
- alert("this side! ".concat(desiredWidth, "x").concat(frame.height));
8140
8139
  var faceCenterX = xMin + width / 2;
8141
8140
  var xPos = Math.max(0, faceCenterX - desiredWidth / 2);
8142
8141
  cropCanvas.width = desiredWidth;
@@ -9176,6 +9175,9 @@
9176
9175
  setModelLoadState('warming');
9177
9176
  setModelWarmingStartedAt(new Date().getTime());
9178
9177
  clearTimeout(modelLoadTimeout);
9178
+ return [4 /*yield*/, testDocumentDetectionAgainstKnownImage(model)];
9179
+ case 1:
9180
+ _b.sent();
9179
9181
  _a = waitForVideoReady(videoRef), videoReady = _a[0], cancel = _a[1];
9180
9182
  cancelled = false;
9181
9183
  cancelVideoReady = function cancelVideoReady() {
@@ -9183,7 +9185,7 @@
9183
9185
  cancel();
9184
9186
  };
9185
9187
  return [4 /*yield*/, videoReady];
9186
- case 1:
9188
+ case 2:
9187
9189
  _b.sent();
9188
9190
  setTimeout(function () {
9189
9191
  if (cancelled) return;
@@ -9422,6 +9424,26 @@
9422
9424
  return !!obj;
9423
9425
  });
9424
9426
  }
9427
+ function testDocumentDetectionAgainstKnownImage(detector) {
9428
+ return new Promise(function (resolve, reject) {
9429
+ var img = new Image();
9430
+ img.crossOrigin = 'anonymous';
9431
+ img.onload = function () {
9432
+ var prediction = detector.detectForVideo(img, performance.now());
9433
+ if (prediction.detections.length > 0) {
9434
+ debug('document detection test result', prediction.detections);
9435
+ resolve(void 0);
9436
+ } else {
9437
+ warn('document detection test failed');
9438
+ reject(new Error('testDocumentDetectionAgainstKnownImage failed to predict'));
9439
+ }
9440
+ };
9441
+ img.onerror = function () {
9442
+ return reject(new Error('testDocumentDetectionAgainstKnownImage failed to load image'));
9443
+ };
9444
+ img.src = "".concat(DEFAULT_CDN_URL, "/id-card-test.jpg");
9445
+ });
9446
+ }
9425
9447
 
9426
9448
  function useFrameLoop(fn, options) {
9427
9449
  if (options === void 0) {