react-native-rectangle-doc-scanner 7.16.0 → 7.17.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.
|
@@ -486,7 +486,13 @@ class CameraController(
|
|
|
486
486
|
?: throw IllegalStateException("Failed to decode JPEG")
|
|
487
487
|
|
|
488
488
|
val rotation = if (exifRotation != 0) exifRotation else computeRotationDegrees()
|
|
489
|
-
val
|
|
489
|
+
val shouldRotate = if (rotation == 90 || rotation == 270) {
|
|
490
|
+
bitmap.width > bitmap.height
|
|
491
|
+
} else {
|
|
492
|
+
bitmap.height > bitmap.width
|
|
493
|
+
}
|
|
494
|
+
val appliedRotation = if (shouldRotate) rotation else 0
|
|
495
|
+
val rotated = rotateAndMirror(bitmap, appliedRotation, useFrontCamera)
|
|
490
496
|
val photoFile = File(pending.outputDirectory, "doc_scan_${System.currentTimeMillis()}.jpg")
|
|
491
497
|
FileOutputStream(photoFile).use { out ->
|
|
492
498
|
rotated.compress(Bitmap.CompressFormat.JPEG, 95, out)
|