idmission-web-sdk 1.0.125 → 1.0.127

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.
@@ -47,7 +47,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
47
47
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
48
48
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
49
49
 
50
- var webSdkVersion = '1.0.125';
50
+ var webSdkVersion = '1.0.127';
51
51
 
52
52
  function getPlatform() {
53
53
  if (typeof window === 'undefined') return;
@@ -10581,7 +10581,27 @@ var CapturedImage = function CapturedImage(_a) {
10581
10581
  function onLoaded(e) {
10582
10582
  if (!bbox || cropped) return;
10583
10583
  setCropped(true);
10584
- setUrl(cropToBoundingBox(e.currentTarget, bbox).toDataURL());
10584
+ var canvas = document.createElement('canvas');
10585
+ // const ctx = canvas.getContext('2d')
10586
+ // if (!ctx) throw new Error('could not get 2d context')
10587
+ //
10588
+ // const [frameWidth, frameHeight] = getFrameDimensions(e.currentTarget)
10589
+ // const [xMin, yMin, width, height] = bbox
10590
+ // canvas.width = width * frameWidth
10591
+ // canvas.height = height * frameHeight
10592
+ // ctx.drawImage(
10593
+ // e.currentTarget,
10594
+ // xMin * frameWidth,
10595
+ // yMin * frameHeight,
10596
+ // width * frameWidth,
10597
+ // height * frameHeight,
10598
+ // 0,
10599
+ // 0,
10600
+ // width * frameWidth,
10601
+ // height * frameHeight,
10602
+ // )
10603
+ drawToCanvas(canvas, e.currentTarget);
10604
+ setUrl(canvas.toDataURL('image/jpeg', 0.95));
10585
10605
  }
10586
10606
  return /*#__PURE__*/React__default['default'].createElement(StyledImage, {
10587
10607
  alt: alt,