@capgo/capacitor-document-scanner 8.4.7 → 8.4.8

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/README.md CHANGED
@@ -5,7 +5,7 @@ Scan paper documents with the native scanner UI: VisionKit on iOS and Google ML
5
5
  <a href="https://capgo.app/?ref=plugin_document_scanner"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-document-scanner" alt="Capgo - Instant updates for Capacitor" /></a>
6
6
 
7
7
  <div align="center">
8
- <p><b>Capgo</b>: open-source live updates for Ionic and Capacitor apps. Ship OTA fixes and features instantly, without waiting for app store review.</p>
8
+ <p><b>Capgo</b>: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.</p>
9
9
  <h2><a href="https://capgo.app/register/?ref=plugin_document_scanner">➡️ Get started for free</a></h2>
10
10
  <p>14-day unlimited free trial. No credit card required</p>
11
11
  <p><a href="https://capgo.app/consulting/?ref=plugin_document_scanner">Missing a feature? We'll build the plugin for you 💪</a></p>
@@ -409,7 +409,7 @@ public class DocumentScannerPlugin extends Plugin {
409
409
  int width = options.outWidth;
410
410
  int inSampleSize = 1;
411
411
 
412
- while ((height / inSampleSize) > reqHeight || (width / inSampleSize) > reqWidth) {
412
+ while (height / inSampleSize > reqHeight || width / inSampleSize > reqWidth) {
413
413
  inSampleSize *= 2;
414
414
  }
415
415
 
@@ -603,9 +603,28 @@ public class DocumentScannerPlugin extends Plugin {
603
603
  */
604
604
  private Bitmap applyBrightnessContrast(Bitmap bitmap, float brightness, float contrast) {
605
605
  // Create ColorMatrix for brightness and contrast
606
- ColorMatrix colorMatrix = new ColorMatrix(
607
- new float[] { contrast, 0, 0, 0, brightness, 0, contrast, 0, 0, brightness, 0, 0, contrast, 0, brightness, 0, 0, 0, 1, 0 }
608
- );
606
+ ColorMatrix colorMatrix = new ColorMatrix(new float[] {
607
+ contrast,
608
+ 0,
609
+ 0,
610
+ 0,
611
+ brightness,
612
+ 0,
613
+ contrast,
614
+ 0,
615
+ 0,
616
+ brightness,
617
+ 0,
618
+ 0,
619
+ contrast,
620
+ 0,
621
+ brightness,
622
+ 0,
623
+ 0,
624
+ 0,
625
+ 1,
626
+ 0
627
+ });
609
628
 
610
629
  // Create a new bitmap with the same dimensions
611
630
  Bitmap adjustedBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig());
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ScannerMode;\n(function (ScannerMode) {\n /**\n * Basic document scanning with crop and rotate features only.\n * No filters or ML-based enhancements.\n */\n ScannerMode[\"Base\"] = \"base\";\n /**\n * Basic features plus automatic filters (grayscale, auto-enhancement).\n */\n ScannerMode[\"BaseWithFilter\"] = \"base_with_filter\";\n /**\n * Full feature set including ML-based image cleaning.\n * Automatically removes stains, fingers, and other artifacts.\n */\n ScannerMode[\"Full\"] = \"full\";\n})(ScannerMode || (ScannerMode = {}));\nexport var ResponseType;\n(function (ResponseType) {\n /**\n * Return scanned images as base64-encoded strings.\n */\n ResponseType[\"Base64\"] = \"base64\";\n /**\n * Return scanned images as file paths on disk.\n */\n ResponseType[\"ImageFilePath\"] = \"imageFilePath\";\n})(ResponseType || (ResponseType = {}));\nexport var ScanDocumentResponseStatus;\n(function (ScanDocumentResponseStatus) {\n /**\n * The scan completed successfully.\n */\n ScanDocumentResponseStatus[\"Success\"] = \"success\";\n /**\n * The user cancelled the scan flow.\n */\n ScanDocumentResponseStatus[\"Cancel\"] = \"cancel\";\n})(ScanDocumentResponseStatus || (ScanDocumentResponseStatus = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst DocumentScanner = registerPlugin('DocumentScanner', {\n web: () => import('./web').then((m) => new m.DocumentScannerWeb()),\n});\nexport * from './definitions';\nexport { DocumentScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DocumentScannerWeb extends WebPlugin {\n async scanDocument(_options) {\n void _options;\n throw this.unimplemented('Document scanning is not supported on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ScannerMode","ResponseType","ScanDocumentResponseStatus","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,WAAW,EAAE;AACxB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC;AACA;AACA;AACA,IAAI,WAAW,CAAC,gBAAgB,CAAC,GAAG,kBAAkB;AACtD;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;AAC1BC;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC;AACA;AACA;AACA,IAAI,YAAY,CAAC,eAAe,CAAC,GAAG,eAAe;AACnD,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;AACX,CAAC,UAAU,0BAA0B,EAAE;AACvC;AACA;AACA;AACA,IAAI,0BAA0B,CAAC,SAAS,CAAC,GAAG,SAAS;AACrD;AACA;AACA;AACA,IAAI,0BAA0B,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACnD,CAAC,EAAEA,kCAA0B,KAAKA,kCAA0B,GAAG,EAAE,CAAC,CAAC;;ACrC9D,MAAC,eAAe,GAAGC,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AAEjC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;AAClF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ScannerMode;\n(function (ScannerMode) {\n /**\n * Basic document scanning with crop and rotate features only.\n * No filters or ML-based enhancements.\n */\n ScannerMode[\"Base\"] = \"base\";\n /**\n * Basic features plus automatic filters (grayscale, auto-enhancement).\n */\n ScannerMode[\"BaseWithFilter\"] = \"base_with_filter\";\n /**\n * Full feature set including ML-based image cleaning.\n * Automatically removes stains, fingers, and other artifacts.\n */\n ScannerMode[\"Full\"] = \"full\";\n})(ScannerMode || (ScannerMode = {}));\nexport var ResponseType;\n(function (ResponseType) {\n /**\n * Return scanned images as base64-encoded strings.\n */\n ResponseType[\"Base64\"] = \"base64\";\n /**\n * Return scanned images as file paths on disk.\n */\n ResponseType[\"ImageFilePath\"] = \"imageFilePath\";\n})(ResponseType || (ResponseType = {}));\nexport var ScanDocumentResponseStatus;\n(function (ScanDocumentResponseStatus) {\n /**\n * The scan completed successfully.\n */\n ScanDocumentResponseStatus[\"Success\"] = \"success\";\n /**\n * The user cancelled the scan flow.\n */\n ScanDocumentResponseStatus[\"Cancel\"] = \"cancel\";\n})(ScanDocumentResponseStatus || (ScanDocumentResponseStatus = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst DocumentScanner = registerPlugin('DocumentScanner', {\n web: () => import('./web').then((m) => new m.DocumentScannerWeb()),\n});\nexport * from './definitions';\nexport { DocumentScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DocumentScannerWeb extends WebPlugin {\n async scanDocument(_options) {\n void _options;\n throw this.unimplemented('Document scanning is not supported on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ScannerMode","ResponseType","ScanDocumentResponseStatus","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,WAAW,EAAE;AACxB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC;AACA;AACA;AACA,IAAI,WAAW,CAAC,gBAAgB,CAAC,GAAG,kBAAkB;AACtD;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;AAC1BC;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC;AACA;AACA;AACA,IAAI,YAAY,CAAC,eAAe,CAAC,GAAG,eAAe;AACnD,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;AACX,CAAC,UAAU,0BAA0B,EAAE;AACvC;AACA;AACA;AACA,IAAI,0BAA0B,CAAC,SAAS,CAAC,GAAG,SAAS;AACrD;AACA;AACA;AACA,IAAI,0BAA0B,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACnD,CAAC,EAAEA,kCAA0B,KAAKA,kCAA0B,GAAG,EAAE,CAAC,CAAC;;ACrC9D,MAAC,eAAe,GAAGC,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AAEjC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;AAClF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ScannerMode;\n(function (ScannerMode) {\n /**\n * Basic document scanning with crop and rotate features only.\n * No filters or ML-based enhancements.\n */\n ScannerMode[\"Base\"] = \"base\";\n /**\n * Basic features plus automatic filters (grayscale, auto-enhancement).\n */\n ScannerMode[\"BaseWithFilter\"] = \"base_with_filter\";\n /**\n * Full feature set including ML-based image cleaning.\n * Automatically removes stains, fingers, and other artifacts.\n */\n ScannerMode[\"Full\"] = \"full\";\n})(ScannerMode || (ScannerMode = {}));\nexport var ResponseType;\n(function (ResponseType) {\n /**\n * Return scanned images as base64-encoded strings.\n */\n ResponseType[\"Base64\"] = \"base64\";\n /**\n * Return scanned images as file paths on disk.\n */\n ResponseType[\"ImageFilePath\"] = \"imageFilePath\";\n})(ResponseType || (ResponseType = {}));\nexport var ScanDocumentResponseStatus;\n(function (ScanDocumentResponseStatus) {\n /**\n * The scan completed successfully.\n */\n ScanDocumentResponseStatus[\"Success\"] = \"success\";\n /**\n * The user cancelled the scan flow.\n */\n ScanDocumentResponseStatus[\"Cancel\"] = \"cancel\";\n})(ScanDocumentResponseStatus || (ScanDocumentResponseStatus = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst DocumentScanner = registerPlugin('DocumentScanner', {\n web: () => import('./web').then((m) => new m.DocumentScannerWeb()),\n});\nexport * from './definitions';\nexport { DocumentScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DocumentScannerWeb extends WebPlugin {\n async scanDocument(_options) {\n void _options;\n throw this.unimplemented('Document scanning is not supported on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ScannerMode","ResponseType","ScanDocumentResponseStatus","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,WAAW,EAAE;IACxB;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;IAChC;IACA;IACA;IACA,IAAI,WAAW,CAAC,gBAAgB,CAAC,GAAG,kBAAkB;IACtD;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;IAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;AAC1BC;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACrC;IACA;IACA;IACA,IAAI,YAAY,CAAC,eAAe,CAAC,GAAG,eAAe;IACnD,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;IACX,CAAC,UAAU,0BAA0B,EAAE;IACvC;IACA;IACA;IACA,IAAI,0BAA0B,CAAC,SAAS,CAAC,GAAG,SAAS;IACrD;IACA;IACA;IACA,IAAI,0BAA0B,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACnD,CAAC,EAAEA,kCAA0B,KAAKA,kCAA0B,GAAG,EAAE,CAAC,CAAC;;ACrC9D,UAAC,eAAe,GAAGC,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IAEjC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;IAClF,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ScannerMode;\n(function (ScannerMode) {\n /**\n * Basic document scanning with crop and rotate features only.\n * No filters or ML-based enhancements.\n */\n ScannerMode[\"Base\"] = \"base\";\n /**\n * Basic features plus automatic filters (grayscale, auto-enhancement).\n */\n ScannerMode[\"BaseWithFilter\"] = \"base_with_filter\";\n /**\n * Full feature set including ML-based image cleaning.\n * Automatically removes stains, fingers, and other artifacts.\n */\n ScannerMode[\"Full\"] = \"full\";\n})(ScannerMode || (ScannerMode = {}));\nexport var ResponseType;\n(function (ResponseType) {\n /**\n * Return scanned images as base64-encoded strings.\n */\n ResponseType[\"Base64\"] = \"base64\";\n /**\n * Return scanned images as file paths on disk.\n */\n ResponseType[\"ImageFilePath\"] = \"imageFilePath\";\n})(ResponseType || (ResponseType = {}));\nexport var ScanDocumentResponseStatus;\n(function (ScanDocumentResponseStatus) {\n /**\n * The scan completed successfully.\n */\n ScanDocumentResponseStatus[\"Success\"] = \"success\";\n /**\n * The user cancelled the scan flow.\n */\n ScanDocumentResponseStatus[\"Cancel\"] = \"cancel\";\n})(ScanDocumentResponseStatus || (ScanDocumentResponseStatus = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst DocumentScanner = registerPlugin('DocumentScanner', {\n web: () => import('./web').then((m) => new m.DocumentScannerWeb()),\n});\nexport * from './definitions';\nexport { DocumentScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DocumentScannerWeb extends WebPlugin {\n async scanDocument(_options) {\n void _options;\n throw this.unimplemented('Document scanning is not supported on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ScannerMode","ResponseType","ScanDocumentResponseStatus","registerPlugin","WebPlug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;;"}
@@ -3,7 +3,7 @@ import Foundation
3
3
 
4
4
  @objc(DocumentScannerPlugin)
5
5
  public class DocumentScannerPlugin: CAPPlugin, CAPBridgedPlugin {
6
- private let pluginVersion: String = "8.4.7"
6
+ private let pluginVersion: String = "8.4.8"
7
7
  public let identifier = "DocumentScannerPlugin"
8
8
  public let jsName = "DocumentScanner"
9
9
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-document-scanner",
3
- "version": "8.4.7",
3
+ "version": "8.4.8",
4
4
  "description": "Capacitor plugin to scan document iOS and Android",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -61,7 +61,7 @@
61
61
  "@ionic/eslint-config": "^0.5.0",
62
62
  "@ionic/prettier-config": "^4.0.0",
63
63
  "@ionic/swiftlint-config": "^2.0.0",
64
- "@types/node": "^24.10.1",
64
+ "@types/node": "^26.0.0",
65
65
  "@typescript-eslint/eslint-plugin": "^8.70.0",
66
66
  "@typescript-eslint/parser": "^8.70.0",
67
67
  "eslint": "^10.0.0",