Skip to content

Commit 57a40bf

Browse files
authored
[camera] Fixes crash on takePicture() (flutter#3537)
* Fixes flutter#75133 * Updated pubspec.yaml and change log * Fix format
1 parent d054fa9 commit 57a40bf

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

packages/camera/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.7.0+4
2+
3+
* Fix crash when taking picture with orientation lock
4+
15
## 0.7.0+3
26

37
* Clockwise rotation of focus point in android

packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/DeviceOrientationManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public int getMediaOrientation() {
5555

5656
public int getMediaOrientation(PlatformChannel.DeviceOrientation orientation) {
5757
int angle = 0;
58+
59+
// Fallback to device orientation when the orientation value is null
60+
if (orientation == null) {
61+
orientation = getUIOrientation();
62+
}
63+
5864
switch (orientation) {
5965
case PORTRAIT_UP:
6066
angle = 0;

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.7.0+3
5+
version: 0.7.0+4
66
homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera
77

88
dependencies:

0 commit comments

Comments
 (0)