File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed
packages/camera/camera_android_camerax Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.6.19
2
+
3
+ * Changes target rotation of captured images to current default display rotation to fix captured
4
+ photo orientation to upright.
5
+
1
6
## 0.6.18+3
2
7
3
8
* Fixes incorrect camera preview mirroring for front cameras of devices using the Impeller backend.
Original file line number Diff line number Diff line change @@ -392,7 +392,8 @@ class AndroidCameraCameraX extends CameraPlatform {
392
392
// Configure ImageCapture instance.
393
393
imageCapture = proxy.newImageCapture (
394
394
resolutionSelector: presetResolutionSelector,
395
- /* use CameraX default target rotation */ targetRotation: null ,
395
+ /* use CameraX default target rotation */ targetRotation:
396
+ await deviceOrientationManager.getDefaultDisplayRotation (),
396
397
);
397
398
398
399
// Configure ImageAnalysis instance.
@@ -966,9 +967,9 @@ class AndroidCameraCameraX extends CameraPlatform {
966
967
await imageCapture! .setFlashMode (CameraXFlashMode .off);
967
968
}
968
969
969
- // Set target rotation to default CameraX rotation only if capture
970
- // orientation not locked.
971
- if (! captureOrientationLocked && shouldSetDefaultRotation ) {
970
+ // Set target rotation to the current default CameraX rotation if
971
+ // the capture orientation is not locked.
972
+ if (! captureOrientationLocked) {
972
973
await imageCapture! .setTargetRotation (
973
974
await deviceOrientationManager.getDefaultDisplayRotation (),
974
975
);
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: camera_android_camerax
2
2
description : Android implementation of the camera plugin using the CameraX library.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5
- version : 0.6.18+3
5
+ version : 0.6.19
6
6
7
7
environment :
8
8
sdk : ^3.7.0
Original file line number Diff line number Diff line change @@ -3488,7 +3488,7 @@ void main() {
3488
3488
);
3489
3489
3490
3490
test (
3491
- 'takePicture sets ImageCapture target rotation to currrent photo rotation when orientation unlocked' ,
3491
+ 'takePicture sets ImageCapture target rotation as expected when orientation locked or unlocked' ,
3492
3492
() async {
3493
3493
final AndroidCameraCameraX camera = AndroidCameraCameraX ();
3494
3494
final MockImageCapture mockImageCapture = MockImageCapture ();
@@ -3531,7 +3531,7 @@ void main() {
3531
3531
// Orientation is unlocked and plugin does not need to set default target
3532
3532
// rotation manually.
3533
3533
await camera.takePicture (cameraId);
3534
- verifyNever (mockImageCapture.setTargetRotation (any ));
3534
+ verify (mockImageCapture.setTargetRotation (defaultTargetRotation ));
3535
3535
3536
3536
// Orientation is locked and plugin does not need to set default target
3537
3537
// rotation manually.
You can’t perform that action at this time.
0 commit comments