ngx-scandoc 15.2.1 → 15.2.2

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.
@@ -810,12 +810,11 @@ class ScanProvider {
810
810
  });
811
811
  return $request;
812
812
  }
813
- burst(Images, BlurValues) {
813
+ burst(Images) {
814
814
  const data = {
815
815
  AcceptTermsAndConditions: true,
816
816
  DataFields: {
817
817
  Images,
818
- BlurValues,
819
818
  },
820
819
  };
821
820
  const $request = this.http.post(this.config.validationPath, data);
@@ -2493,7 +2492,6 @@ class ScanComponent extends BaseComponent {
2493
2492
  Response: null,
2494
2493
  ExpectedOutput: null,
2495
2494
  };
2496
- this.blurValues = [];
2497
2495
  this.scanDatas = [];
2498
2496
  this.idScan = null;
2499
2497
  this.validation = false;
@@ -2591,7 +2589,6 @@ class ScanComponent extends BaseComponent {
2591
2589
  this.scannedImages = [];
2592
2590
  const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
2593
2591
  this.validation = true;
2594
- // console.log('BURST');
2595
2592
  this.handleBurstData(imagesArray, images);
2596
2593
  }
2597
2594
  else {
@@ -2602,7 +2599,7 @@ class ScanComponent extends BaseComponent {
2602
2599
  });
2603
2600
  }
2604
2601
  handleBurstData(imagesArray, images, type = 'plain') {
2605
- this.__subs(this.scanProvider.burst(imagesArray, this.blurValues)).subscribe((resp) => {
2602
+ this.__subs(this.scanProvider.burst(imagesArray)).subscribe((resp) => {
2606
2603
  this.displayInfo = 'scandoc.info.c' + resp.InfoCode;
2607
2604
  // console.timeEnd('validationPOST');
2608
2605
  // console.log('AnalysisTime', resp.AnalysisTime);
@@ -2611,13 +2608,6 @@ class ScanComponent extends BaseComponent {
2611
2608
  // this.handleLongValidationError(image);
2612
2609
  // }
2613
2610
  // console.warn(resp.Validated, this.numberOfValidations);
2614
- if (resp.DetectedBlurValue) {
2615
- this.blurValues.push(resp.DetectedBlurValue);
2616
- }
2617
- else {
2618
- this.blurValues = [];
2619
- }
2620
- console.log();
2621
2611
  if (resp.Validated) {
2622
2612
  this.numberOfValidations++;
2623
2613
  this.validationDebug.push(resp);
@@ -2626,7 +2616,7 @@ class ScanComponent extends BaseComponent {
2626
2616
  this.numberOfValidations = 0;
2627
2617
  this.validationDebug = [];
2628
2618
  }
2629
- if (resp.Validated) {
2619
+ if (this.numberOfValidations >= 3) {
2630
2620
  this.displayInfo = '';
2631
2621
  // console.log('[SCANNED INDEX]', resp.Index);
2632
2622
  const selectedImage = images[resp.Index];
@@ -2655,7 +2645,6 @@ class ScanComponent extends BaseComponent {
2655
2645
  this.scanBlastFinish();
2656
2646
  }
2657
2647
  else {
2658
- this.blurValues = [];
2659
2648
  this.numberOfValidations = 0;
2660
2649
  // console.warn('DEBUG',Side,this.validationDebug)
2661
2650
  this.validationDebug = [];
@@ -2771,6 +2760,43 @@ class ScanComponent extends BaseComponent {
2771
2760
  this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
2772
2761
  console.log('MNOBILE', this.isMobile);
2773
2762
  });
2763
+ // this.imageHandlerSubscription = this.imageHandler.subscribe(
2764
+ // (webcamImage: any) => {
2765
+ // // return;
2766
+ // if (this.startTime === 0) {
2767
+ // this.startTime = Date.now();
2768
+ // }
2769
+ // this.zone.runOutsideAngular(() => {
2770
+ // if (webcamImage.base64) {
2771
+ // const time = new Date().getTime();
2772
+ // if (this.scanImageTimestamps.load > 0) {
2773
+ // const { load } = this.scanImageTimestamps;
2774
+ // const diff = time - load;
2775
+ // // console.warn('TIME', diff);
2776
+ // this.scanDelay = diff;
2777
+ // }
2778
+ // this.scanImageTimestamps.load = time;
2779
+ // this.scannedImages.push(webcamImage);
2780
+ // this.handleLongValidationError(webcamImage, 'worker');
2781
+ // }
2782
+ // // this.cd.detectChanges();
2783
+ // if (this.scannedImages.length > 4 && !this.validation) {
2784
+ // // get last 10
2785
+ // console.timeEnd('validationTOTAL_UI');
2786
+ // console.time('validationTOTAL_UI');
2787
+ // const images = this.scannedImages.slice(-5);
2788
+ // // set images to 0
2789
+ // this.scannedImages = [];
2790
+ // console.log(images);
2791
+ // const imagesArray = images.map((m) => m.base64.split(',')[1]);
2792
+ // this.validation = true;
2793
+ // // this.handleBurstData(imagesArray, images, 'worker');
2794
+ // console.time('validationPOST');
2795
+ // }
2796
+ // this.cd.detectChanges();
2797
+ // });
2798
+ // }
2799
+ // );
2774
2800
  }
2775
2801
  handleBitmapImage(bitmap) {
2776
2802
  const { width, height } = bitmap;