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.
- package/dist/FullDocScanner.js +12 -2
- package/package.json +1 -1
- package/src/FullDocScanner.tsx +11 -2
package/dist/FullDocScanner.js
CHANGED
|
@@ -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
|
-
//
|
|
117
|
-
|
|
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
package/src/FullDocScanner.tsx
CHANGED
|
@@ -159,8 +159,17 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
|
|
|
159
159
|
|
|
160
160
|
const normalizedDoc = normalizeCapturedDocument(document);
|
|
161
161
|
|
|
162
|
-
//
|
|
163
|
-
|
|
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
|
);
|