react-native-rectangle-doc-scanner 3.44.1 → 3.44.2

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.
@@ -113,8 +113,18 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
113
113
  manualCapturePending.current = false;
114
114
  }
115
115
  const normalizedDoc = normalizeCapturedDocument(document);
116
- // Open cropper with the captured image
117
- await openCropper(normalizedDoc.path);
116
+ // Auto-capture: Use already cropped image, skip cropper
117
+ if (document.origin === 'auto' && normalizedDoc.croppedPath) {
118
+ console.log('[FullDocScanner] Auto-capture: using pre-cropped image');
119
+ setCroppedImageData({
120
+ path: normalizedDoc.croppedPath,
121
+ });
122
+ }
123
+ else {
124
+ // Manual capture or gallery: Open cropper
125
+ console.log('[FullDocScanner] Manual capture: opening cropper');
126
+ await openCropper(normalizedDoc.path);
127
+ }
118
128
  }, [openCropper]);
119
129
  const triggerManualCapture = (0, react_1.useCallback)(() => {
120
130
  console.log('[FullDocScanner] triggerManualCapture called');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.44.1",
3
+ "version": "3.44.2",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -159,8 +159,17 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
159
159
 
160
160
  const normalizedDoc = normalizeCapturedDocument(document);
161
161
 
162
- // Open cropper with the captured image
163
- await openCropper(normalizedDoc.path);
162
+ // Auto-capture: Use already cropped image, skip cropper
163
+ if (document.origin === 'auto' && normalizedDoc.croppedPath) {
164
+ console.log('[FullDocScanner] Auto-capture: using pre-cropped image');
165
+ setCroppedImageData({
166
+ path: normalizedDoc.croppedPath,
167
+ });
168
+ } else {
169
+ // Manual capture or gallery: Open cropper
170
+ console.log('[FullDocScanner] Manual capture: opening cropper');
171
+ await openCropper(normalizedDoc.path);
172
+ }
164
173
  },
165
174
  [openCropper],
166
175
  );