react-native-rectangle-doc-scanner 3.185.0 → 3.188.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.
|
@@ -108,7 +108,8 @@ class CameraController(
|
|
|
108
108
|
// Preview use case
|
|
109
109
|
Log.d(TAG, "[BIND] Creating Preview use case...")
|
|
110
110
|
val preview = Preview.Builder()
|
|
111
|
-
.
|
|
111
|
+
// Use aspect ratio to avoid unsupported size combinations on some devices.
|
|
112
|
+
.setTargetAspectRatio(AspectRatio.RATIO_4_3)
|
|
112
113
|
.build()
|
|
113
114
|
Log.d(TAG, "[BIND] Preview created: $preview")
|
|
114
115
|
|
|
@@ -116,7 +117,8 @@ class CameraController(
|
|
|
116
117
|
Log.d(TAG, "[BIND] Creating ImageCapture use case...")
|
|
117
118
|
imageCapture = ImageCapture.Builder()
|
|
118
119
|
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
|
|
119
|
-
.
|
|
120
|
+
// Use aspect ratio to avoid unsupported size combinations on some devices.
|
|
121
|
+
.setTargetAspectRatio(AspectRatio.RATIO_4_3)
|
|
120
122
|
.setFlashMode(ImageCapture.FLASH_MODE_AUTO)
|
|
121
123
|
.build()
|
|
122
124
|
Log.d(TAG, "[BIND] ImageCapture created: $imageCapture")
|
|
@@ -125,7 +127,8 @@ class CameraController(
|
|
|
125
127
|
imageAnalysis = if (enableDetection) {
|
|
126
128
|
Log.d(TAG, "[BIND] Creating ImageAnalysis use case...")
|
|
127
129
|
ImageAnalysis.Builder()
|
|
128
|
-
.
|
|
130
|
+
// Use aspect ratio to avoid unsupported size combinations on some devices.
|
|
131
|
+
.setTargetAspectRatio(AspectRatio.RATIO_4_3)
|
|
129
132
|
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
|
|
130
133
|
.setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_YUV_420_888)
|
|
131
134
|
.build()
|
package/package.json
CHANGED