ngx-scandoc 1.0.2 → 1.0.4
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.
- package/core/components/scan/scan.component.d.ts +0 -1
- package/esm2020/core/components/scan/scan.component.mjs +6 -11
- package/esm2020/core/components/webcam/webcam/webcam.component.mjs +7 -2
- package/fesm2015/ngx-scandoc.mjs +11 -11
- package/fesm2015/ngx-scandoc.mjs.map +1 -1
- package/fesm2020/ngx-scandoc.mjs +11 -11
- package/fesm2020/ngx-scandoc.mjs.map +1 -1
- package/package.json +5 -2
package/fesm2020/ngx-scandoc.mjs
CHANGED
|
@@ -664,6 +664,7 @@ class WebcamComponent extends BaseComponent {
|
|
|
664
664
|
this.video.nativeElement.setAttribute('width', this.canvasSize.width);
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
+
this.drawRectangle();
|
|
667
668
|
this.cd.detectChanges();
|
|
668
669
|
}
|
|
669
670
|
setupWorker() {
|
|
@@ -976,6 +977,8 @@ class WebcamComponent extends BaseComponent {
|
|
|
976
977
|
frameRate: { min: 20, ideal: 30, max: 31 },
|
|
977
978
|
};
|
|
978
979
|
}
|
|
980
|
+
// desired.height.ideal = 1000;
|
|
981
|
+
// desired.width.ideal = 1000;
|
|
979
982
|
if (desired.height.ideal && desired.height.ideal >= 1600) {
|
|
980
983
|
desired.height.ideal = 1600;
|
|
981
984
|
desired.width.ideal = 1600;
|
|
@@ -1105,17 +1108,19 @@ class WebcamComponent extends BaseComponent {
|
|
|
1105
1108
|
get cardRectangle() {
|
|
1106
1109
|
const _canvas = this.canvas.nativeElement;
|
|
1107
1110
|
const docSize = this.type === 'selfie' ? 1 : 86 / 55;
|
|
1111
|
+
console.log(_canvas.width, _canvas.height);
|
|
1108
1112
|
let padding = 10;
|
|
1109
1113
|
let rWidth = _canvas.width - 2 * padding;
|
|
1110
1114
|
let rHeight = rWidth / docSize;
|
|
1111
1115
|
let top = (_canvas.height - rHeight) / 2;
|
|
1112
|
-
if (!this.isMobile) {
|
|
1116
|
+
if ((!this.isMobile && _canvas.width !== _canvas.height)) {
|
|
1113
1117
|
padding = 40;
|
|
1114
1118
|
rHeight = _canvas.height - 2 * padding;
|
|
1115
1119
|
rWidth = rHeight * docSize;
|
|
1116
1120
|
top = (_canvas.height - rHeight) / 2;
|
|
1117
1121
|
padding = (_canvas.width - rWidth) / 2;
|
|
1118
1122
|
}
|
|
1123
|
+
console.log(padding, top, rWidth, rHeight);
|
|
1119
1124
|
return { padding, top, rWidth, rHeight };
|
|
1120
1125
|
}
|
|
1121
1126
|
get snapRectangle() {
|
|
@@ -2426,9 +2431,6 @@ class ScanComponent extends BaseComponent {
|
|
|
2426
2431
|
this.cd.detectChanges();
|
|
2427
2432
|
}
|
|
2428
2433
|
}
|
|
2429
|
-
test() {
|
|
2430
|
-
this.dialogs.turnDocument('BACK');
|
|
2431
|
-
}
|
|
2432
2434
|
resetLogData() {
|
|
2433
2435
|
this.logData = {
|
|
2434
2436
|
Request: null,
|
|
@@ -2554,16 +2556,12 @@ class ScanComponent extends BaseComponent {
|
|
|
2554
2556
|
this.zone.run(() => {
|
|
2555
2557
|
this.dialogs.turnDocument(this.idScan).subscribe(() => {
|
|
2556
2558
|
this.showDialog = false;
|
|
2559
|
+
this.validation = false;
|
|
2557
2560
|
});
|
|
2558
2561
|
});
|
|
2559
|
-
// this.actions.emit({
|
|
2560
|
-
// type: 'turnDocumentOver',
|
|
2561
|
-
// side: this.idScan,
|
|
2562
|
-
// });
|
|
2563
2562
|
}
|
|
2564
2563
|
console.log('ID SIDE', this.idScan);
|
|
2565
2564
|
this.displayInfo = 'Please turn the document over!';
|
|
2566
|
-
this.validation = false;
|
|
2567
2565
|
}
|
|
2568
2566
|
}
|
|
2569
2567
|
else {
|
|
@@ -2605,11 +2603,13 @@ class ScanComponent extends BaseComponent {
|
|
|
2605
2603
|
handleLongValidationError(img) {
|
|
2606
2604
|
// save current image after 10sec
|
|
2607
2605
|
const diff = (Date.now() - this.startTime) / 1000;
|
|
2608
|
-
if (diff > 15 &&
|
|
2606
|
+
if (diff > 15 &&
|
|
2607
|
+
!this.verificationErrorSent &&
|
|
2608
|
+
this.scanProvider.config.development) {
|
|
2609
2609
|
this.verificationErrorSent = true;
|
|
2610
2610
|
const dataUrl = this.handleBitmapImage(img.bitmap);
|
|
2611
2611
|
console.warn('SENT');
|
|
2612
|
-
this.displayInfo = 'Cant detect document!';
|
|
2612
|
+
// this.displayInfo = 'Cant detect document!';
|
|
2613
2613
|
this.logData.Request = this.__subs(this.scanProvider.sendLog({
|
|
2614
2614
|
AcceptTermsAndConditions: true,
|
|
2615
2615
|
ExpectedOutput: {},
|