@capturebridge/sdk 0.11.2 → 0.11.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/CHANGELOG.md +7 -0
- package/ICAO.js +6 -2
- package/IFace.js +5 -2
- package/Version.js +1 -1
- package/examples/icao.js +1 -1
- package/package.json +2 -1
- package/types.d.ts +126 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.11.4] - 2024-07-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `background` parameter to `ICAO.check()` and `IFace.icao()` that will
|
|
13
|
+
fill in any part of the cropped image that falls outside the source image.
|
|
14
|
+
|
|
8
15
|
## [0.11.0] - 2024-06-21
|
|
9
16
|
|
|
10
17
|
### Added
|
package/ICAO.js
CHANGED
|
@@ -32,6 +32,9 @@ class ICAO extends Plugin {
|
|
|
32
32
|
* the value will be interpreted as the preferred crop method which will vary
|
|
33
33
|
* by plugin implementation.
|
|
34
34
|
*
|
|
35
|
+
* @param {string} [background=#ffffff] - Hexadecimal color that will fill in
|
|
36
|
+
* any part of the cropped image that falls outside the original source image.
|
|
37
|
+
*
|
|
35
38
|
* @returns {object} Results of the ICAO check, this may vary by plugin
|
|
36
39
|
* implementation.
|
|
37
40
|
*
|
|
@@ -48,7 +51,7 @@ class ICAO extends Plugin {
|
|
|
48
51
|
* console.log(`found ${result.faces_found} faces in the image`)
|
|
49
52
|
* document.body.appendChild(img)
|
|
50
53
|
*/
|
|
51
|
-
async check (image, cropMethod = false) {
|
|
54
|
+
async check (image, cropMethod = false, cropBackground) {
|
|
52
55
|
let imageData
|
|
53
56
|
|
|
54
57
|
// If this is an ImageSource object fetch it's image data
|
|
@@ -63,7 +66,8 @@ class ICAO extends Plugin {
|
|
|
63
66
|
const body = {
|
|
64
67
|
base64: imageData,
|
|
65
68
|
crop: Boolean(cropMethod),
|
|
66
|
-
crop_method: cropMethod || undefined
|
|
69
|
+
crop_method: cropMethod || undefined,
|
|
70
|
+
crop_background: cropBackground || undefined
|
|
67
71
|
}
|
|
68
72
|
const options = {
|
|
69
73
|
method: 'POST',
|
package/IFace.js
CHANGED
|
@@ -131,6 +131,9 @@ export class IFace extends ICAO {
|
|
|
131
131
|
* the value will be interpreted as the preferred crop method which will vary
|
|
132
132
|
* by plugin implementation.
|
|
133
133
|
*
|
|
134
|
+
* @param {string} [background=#ffffff] - Hexadecimal color that will fill in
|
|
135
|
+
* any part of the cropped image that falls outside the original source image.
|
|
136
|
+
*
|
|
134
137
|
* @returns {object} Results of the ICAO check, this may vary by plugin
|
|
135
138
|
* implementation.
|
|
136
139
|
*
|
|
@@ -147,8 +150,8 @@ export class IFace extends ICAO {
|
|
|
147
150
|
* console.log(`found ${result.faces_found} faces in the image`)
|
|
148
151
|
* document.body.appendChild(img)
|
|
149
152
|
*/
|
|
150
|
-
async icao (image, cropMethod = false) {
|
|
151
|
-
return await this.check(image, cropMethod)
|
|
153
|
+
async icao (image, cropMethod = false, cropBackground) {
|
|
154
|
+
return await this.check(image, cropMethod, cropBackground)
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
/**
|
package/Version.js
CHANGED
package/examples/icao.js
CHANGED
|
@@ -7,7 +7,7 @@ import ImageSource from '../../../../sdk/js/ImageSource.js'
|
|
|
7
7
|
const imgSrc = new ImageSource('icao.jpg', 'url')
|
|
8
8
|
|
|
9
9
|
// Perform an ICAO check against the provided Image and return cropped
|
|
10
|
-
const results = await icao.check(imgSrc, true)
|
|
10
|
+
const results = await icao.check(imgSrc, true, '#a5a5a5')
|
|
11
11
|
|
|
12
12
|
// Our stock photo is zoomed in too close, so we pad the canvas to allow for
|
|
13
13
|
// drawing a box around the cropped portion
|
package/package.json
CHANGED
package/types.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
declare module '@capturebridge/sdk/Camera' {
|
|
3
|
+
const Camera: any;
|
|
4
|
+
export default Camera;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare module '@capturebridge/sdk/CanonCamera' {
|
|
8
|
+
const CanonCamera: any;
|
|
9
|
+
export default CanonCamera;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '@capturebridge/sdk/CaptureBridge' {
|
|
13
|
+
const CaptureBridge: any;
|
|
14
|
+
export default CaptureBridge;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module '@capturebridge/sdk/CapturePlugin' {
|
|
18
|
+
const CapturePlugin: any;
|
|
19
|
+
export default CapturePlugin;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module '@capturebridge/sdk/Device' {
|
|
23
|
+
const Device: any;
|
|
24
|
+
export default Device;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare module '@capturebridge/sdk/ICAO' {
|
|
28
|
+
const ICAO: any;
|
|
29
|
+
export default ICAO;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module '@capturebridge/sdk/Probe' {
|
|
33
|
+
const Probe: any;
|
|
34
|
+
export default Probe;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare module '@capturebridge/sdk/Candidate' {
|
|
38
|
+
const Candidate: any;
|
|
39
|
+
export default Candidate;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module '@capturebridge/sdk/IFace' {
|
|
43
|
+
const IFace: any;
|
|
44
|
+
export default IFace;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare module '@capturebridge/sdk/ImageSource' {
|
|
48
|
+
const ImageSource: any;
|
|
49
|
+
export default ImageSource;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare module '@capturebridge/sdk/Logs' {
|
|
53
|
+
const Logs: any;
|
|
54
|
+
export default Logs;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare module '@capturebridge/sdk/MockCamera' {
|
|
58
|
+
const MockCamera: any;
|
|
59
|
+
export default MockCamera;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module '@capturebridge/sdk/Plugin' {
|
|
63
|
+
const Plugin: any;
|
|
64
|
+
export default Plugin;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare module '@capturebridge/sdk/Scanner' {
|
|
68
|
+
const Scanner: any;
|
|
69
|
+
export default Scanner;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare module '@capturebridge/sdk/SignatureTablet' {
|
|
73
|
+
const SignatureTablet: any;
|
|
74
|
+
export default SignatureTablet;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare module '@capturebridge/sdk/DisplayWidget' {
|
|
78
|
+
const DisplayWidget: any;
|
|
79
|
+
export default DisplayWidget;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare module '@capturebridge/sdk/TextButton' {
|
|
83
|
+
const TextButton: any;
|
|
84
|
+
export default TextButton;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare module '@capturebridge/sdk/Text' {
|
|
88
|
+
const Text: any;
|
|
89
|
+
export default Text;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare module '@capturebridge/sdk/Image' {
|
|
93
|
+
const Image: any;
|
|
94
|
+
export default Image;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare module '@capturebridge/sdk/StreamingCapturePlugin' {
|
|
98
|
+
const StreamingCapturePlugin: any;
|
|
99
|
+
export default StreamingCapturePlugin;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare module '@capturebridge/sdk/TopazSigGem' {
|
|
103
|
+
const TopazSigGem: any;
|
|
104
|
+
export default TopazSigGem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare module '@capturebridge/sdk/ControlProperty' {
|
|
108
|
+
const ControlProperty: any;
|
|
109
|
+
export default ControlProperty;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare module '@capturebridge/sdk/DeviceForm' {
|
|
113
|
+
const DeviceForm: any;
|
|
114
|
+
export default DeviceForm;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare module '@capturebridge/sdk/Verifone' {
|
|
118
|
+
const Verifone: any;
|
|
119
|
+
export default Verifone;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare module '@capturebridge/sdk/WindowsScanner' {
|
|
123
|
+
const WindowsScanner: any;
|
|
124
|
+
export default WindowsScanner;
|
|
125
|
+
}
|
|
126
|
+
|