@capturebridge/sdk 0.26.4 → 0.28.0

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/ICAO.js CHANGED
@@ -35,6 +35,10 @@ class ICAO extends Plugin {
35
35
  * @param {string} [background=#ffffff] - Hexadecimal color that will fill in
36
36
  * any part of the cropped image that falls outside the original source image.
37
37
  *
38
+ * @param {number} [cropEnlargement] - If either `full_frontal_extended` or
39
+ * `token_frontal_extended` are supplied for the `crop` argument, this value
40
+ * defines the amount of background image area enlargement.
41
+ *
38
42
  * @returns {object} Results of the ICAO check, this may vary by plugin
39
43
  * implementation.
40
44
  *
@@ -51,7 +55,7 @@ class ICAO extends Plugin {
51
55
  * console.log(`found ${result.faces_found} faces in the image`)
52
56
  * document.body.appendChild(img)
53
57
  */
54
- async check (image, cropMethod = false, cropBackground) {
58
+ async check (image, cropMethod = false, cropBackground, cropEnlargement) {
55
59
  let imageData
56
60
 
57
61
  // If this is an ImageSource object fetch it's image data
@@ -67,7 +71,8 @@ class ICAO extends Plugin {
67
71
  base64: imageData,
68
72
  crop: Boolean(cropMethod),
69
73
  crop_method: cropMethod || undefined,
70
- crop_background: cropBackground || undefined
74
+ crop_background: cropBackground || undefined,
75
+ crop_enlargement: cropEnlargement
71
76
  }
72
77
  const options = {
73
78
  method: 'POST',
package/ImageSource.js CHANGED
@@ -19,7 +19,7 @@ export class ImageSource {
19
19
  * are 'url', 'base64', and 'dataurl'. If not provided 'base64' is the default.
20
20
  *
21
21
  * @example
22
- * const personPhoto = new ImageSource('/person/123.jpg', '123', 'url')
22
+ * const personPhoto = new ImageSource('/person/123.jpg', 'url')
23
23
  */
24
24
  constructor (source, type = 'base64') {
25
25
  // TODO:
@@ -89,10 +89,8 @@ export class ImageSource {
89
89
  img.src = this.url
90
90
  break
91
91
  case 'base64':
92
- img.src = base64ToDataURL(this.imageData)
93
- break
94
92
  case 'dataurl':
95
- img.src = this.source
93
+ img.src = base64ToDataURL(this.imageData)
96
94
  break
97
95
  case undefined:
98
96
  case null:
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # Capture Bridge JavaScript Client SDK
2
2
 
3
- - [SDK Documentation for v0.26.4](https://docs.capturebridge.net/client/sdk/javascript/0.26.4/index.html)
4
- - [SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.26.4/CHANGELOG.html)
3
+ - [SDK Documentation for v0.28.0](https://docs.capturebridge.net/client/sdk/javascript/0.28.0/index.html)
4
+ - [SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.28.0/CHANGELOG.html)
package/Version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * @constant
5
5
  * @type {string}
6
6
  */
7
- const VERSION = '0.26.4'
7
+ const VERSION = '0.28.0'
8
8
  export default VERSION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capturebridge/sdk",
3
- "version": "0.26.4",
3
+ "version": "0.28.0",
4
4
  "description": "Capture Bridge JavaScript client SDK",
5
5
  "type": "module",
6
6
  "types": "types.d.ts",