react-native-rectangle-doc-scanner 3.222.0 → 3.224.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.
@@ -175,50 +175,43 @@ class CameraController(
175
175
 
176
176
  val rotation = previewView.display?.rotation ?: Surface.ROTATION_0
177
177
 
178
- // Build Preview with lower resolution
178
+ // Build Preview ONLY - this device cannot handle 2 simultaneous surfaces initially
179
179
  preview = Preview.Builder()
180
180
  .setTargetResolution(Size(1280, 720))
181
181
  .setTargetRotation(rotation)
182
182
  .build()
183
183
  .also {
184
+ // IMPORTANT: Set surface provider BEFORE binding
184
185
  it.setSurfaceProvider(previewView.surfaceProvider)
185
186
  }
186
187
 
187
- // Build ImageCapture for periodic frame capture (instead of ImageAnalysis)
188
- imageCapture = ImageCapture.Builder()
189
- .setTargetResolution(Size(640, 480))
190
- .setTargetRotation(rotation)
191
- .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
192
- .build()
193
-
194
188
  val cameraSelector = if (useFrontCamera) {
195
189
  CameraSelector.DEFAULT_FRONT_CAMERA
196
190
  } else {
197
191
  CameraSelector.DEFAULT_BACK_CAMERA
198
192
  }
199
193
 
200
- // Bind Preview and ImageCapture together
194
+ // Bind Preview ONLY first
201
195
  try {
202
196
  camera = provider.bindToLifecycle(
203
197
  lifecycleOwner,
204
198
  cameraSelector,
205
- preview,
206
- imageCapture
199
+ preview
207
200
  )
208
- Log.d(TAG, "[CAMERAX-V6] Preview + ImageCapture bound successfully")
209
201
 
210
- // Start periodic frame capture for analysis
211
- if (detectionEnabled) {
212
- isAnalysisActive = true
213
- analysisHandler.postDelayed(analysisRunnable, 500) // Start after 500ms
214
- Log.d(TAG, "[CAMERAX-V6] Started periodic frame capture for analysis")
215
- }
202
+ Log.d(TAG, "[CAMERAX-V8] Preview ONLY bound successfully - camera preview should be visible")
203
+
204
+ // DO NOT try to add ImageCapture - this device cannot handle it
205
+ // Keep Preview only mode
206
+ Log.d(TAG, "[CAMERAX-V8] Running in Preview-only mode (no auto-detection)")
216
207
 
217
208
  } catch (e: Exception) {
218
- Log.e(TAG, "[CAMERAX-V6] Failed to bind camera use cases", e)
209
+ Log.e(TAG, "[CAMERAX-V8] Failed to bind preview", e)
219
210
  }
220
211
  }
221
212
 
213
+ // Function removed - this device cannot handle ImageCapture + Preview simultaneously
214
+
222
215
  private fun captureFrameForAnalysis() {
223
216
  val capture = imageCapture ?: return
224
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.222.0",
3
+ "version": "3.224.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",