Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[camera] Camera viewer is over exposed as a result images taken w/ flash mode come out washed out on Samsung devices with Android 11 #88070

Open
anthonycastelli opened this issue Aug 11, 2021 · 14 comments
Labels
e: device-specific Only manifests on certain devices e: OS-version specific Affects only some versions of the relevant operating system found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@anthonycastelli
Copy link

anthonycastelli commented Aug 11, 2021

When trying to take a picture with the FlashMode set to auto or always, the image is over exposed causing everything to be extremely washed out.

I have set the ExposureMode and FocusMode to auto (which it defaults to as well) with no luck.

This issue was not present on my Samsung S9 running Android 10 or on iOS
The issue appears to be on Android 11 on my Samsung S21 or my other test device Samsung S10

Steps to Reproduce

  1. Initialize the camera
  2. Call the takePicture() method
  3. View the image
  4. Image is over exposed
Preview

Logs

Logs

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale en-US)
    • Flutter version 2.2.3 at /Users/anthony/fvm/versions/stable
    • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc3)
    • Android SDK at /Users/anthony/Library/Android/sdk
    • Platform android-30, build-tools 31.0.0-rc3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.58.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (2 available)
    • SM G991U1 (mobile) • R5CR717Z9SZ • android-arm64  • Android 11 (API 30)
    • Chrome (web)       • chrome      • web-javascript • Google Chrome 92.0.4515.131

• No issues found!
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Aug 12, 2021
@TahaTesser
Copy link
Member

TahaTesser commented Aug 12, 2021

Hi @anthonycastelli
Thanks for filing the issue, I can reproduce the issue on a Samsung device running Android 11 (Unfortunately I don't have a Samsung device with Android 10). Not only when taking pictures, but just camera viewer without taking a photo also looks overexposed on Samsung or it shifts expose drastically when moving the camera between different objects. Of course, reproduced with auto settings.

Comparison

Screenshot 2021-08-12 at 14 55 31

Version

camera: ^0.8.1+7

Code Sample

https://pub.dev/packages/camera/example

stable master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5294g darwin-x64, locale en-GB)
    • Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-31, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Code/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Xcode 13.0, Build version 13A5212g
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
    • Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.59.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (3 available)
    • SM M025F (mobile) • R9ZR205XX0A • android-arm    • Android 11 (API 30)
    • macOS (desktop)   • macos       • darwin-x64     • macOS 12.0 21A5294g darwin-x64
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 92.0.4515.131

! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.5.0-6.0.pre.63, on macOS 12.0 21A5294g darwin-x64, locale en-GB)
    • Flutter version 2.5.0-6.0.pre.63 at /Users/tahatesser/Code/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 047d35d8ba (7 hours ago), 2021-08-12 12:47:05 +0800
    • Engine revision a2e60472a9
    • Dart version 2.15.0 (build 2.15.0-5.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-31, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Xcode 13.0, Build version 13A5212g
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Android Studio (version 2020.3)
    • Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.59.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (3 available)
    • SM M025F (mobile) • R9ZR205XX0A • android-arm    • Android 11 (API 30)
    • macOS (desktop)   • macos       • darwin-x64     • macOS 12.0 21A5294g darwin-x64
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 92.0.4515.131

• No issues found!

✅: No Issue ❌: Issue reproduced

@TahaTesser TahaTesser changed the title [camera] Camera 0.8.1+7 FlashMode ALWAYS Fails to expose correctly on Android 11 Samsung S21 [camera] Camera viewer is over exposed as a result images taken w/ flash mode come out washed out on Samsung devices with Android 11 Aug 12, 2021
@TahaTesser TahaTesser added e: device-specific Only manifests on certain devices e: OS-version specific Affects only some versions of the relevant operating system found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin p: first party platform-android Android applications specifically and removed in triage Presently being triaged by the triage team labels Aug 12, 2021
@anthonycastelli
Copy link
Author

@TahaTesser If you set the flash to Always, does it get extremely washed out for you too? I can put together an example project if needed as well.

@TahaTesser
Copy link
Member

@anthonycastelli
I just borrowed Samsung A6 (Android 10), it doesn't look washed out

@TahaTesser
Copy link
Member

@anthonycastelli
Yes, always on Flash but as I said overall camera viewer is already over-exposed and since I reproduce the issue using an official sample and clearly Android 11 results matches your result, I don't think we need a project from you.

@anthonycastelli
Copy link
Author

@TahaTesser Okay. Perfect. Glad it can be reproduced. Just wanted to get all of the info to you that you needed.

This is a bit of a blocker for us so if any workaround or fix is discovered, definitely let me know!

@stuartmorgan stuartmorgan added the P2 Important issues not at the top of the work list label Aug 13, 2021
@anthonycastelli
Copy link
Author

@TahaTesser Just wanted to circle back and see if there was any progress on this?

@alhe99
Copy link

alhe99 commented Jan 19, 2022

@TahaTesser did you resolved this? i have the same problem with exposed images with auto/always flash mode, i played it in a samsung galaxy note 10 with android 11 with ^0.8.1+7 version, with latest camera version the flash is get in trouble.

@avmax
Copy link

avmax commented Apr 24, 2022

@anthonycastelli @TahaTesser

Hey yo!
Tell please:

  1. Is there a solution to this problem now?
  2. Looks like I have the same problem yea?

@anthonycastelli
Copy link
Author

@avmax No, I did not resolve it. For the app I was building, I did find a work around, and that was to turn the flash on torch mode vs auto mode for Android. This served the correct purpose I needed, but I know this isn't something everyone can do.

@avmax
Copy link

avmax commented Apr 25, 2022

@anthonycastelli thank you for answer and workaround! Tried the same this night :D
Did u add delay for any milliseconds between switching the torch on and making a photoshot?

@anthonycastelli
Copy link
Author

@avmax I did yes. I think I used half a second or something, but this was all triggered on the initState method.

@gerken-tss
Copy link

gerken-tss commented Nov 8, 2022

I can't believe this issue exists for over a year now and nothing has been done to fix it!
Do people realize that this bug together with this issue makes Flutter effectively unusable for apps with a camera feature with a bigger audience?

I can't put the camera on torch mode. I am working on a serious business app with thousands of users. How am I supposed to make it work on Android? Is there any workaround?

Btw: Other than the title suggests, this issue is not limited to Android 11. In fact, I have experienced this on Android 11, 12 and 13!

gerken-tss added a commit to gerken-tss/plugins that referenced this issue Nov 17, 2022
@gerken-tss
Copy link

@anthonycastelli @avmax

I guess I fixed the bug. Can you guys confirm by putting the following lines in the pubspec.yaml of your project:

camera:
  git:
    url: git@github.com:gerken-tss/plugins.git
    ref: issue-88070-overexposure
    path: packages/camera/camera

If you can confirm, I will create a PR.

Thank you in advance!

gerken-tss added a commit to gerken-tss/plugins that referenced this issue Nov 18, 2022
@AshotKhachatryan1995
Copy link

This is same place. Taken with camera app and with my app(with flash mode)

Device: Google Pixel 6a, Version: Android 13

1675764230167
CAP7025457275868111188

@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: device-specific Only manifests on certain devices e: OS-version specific Affects only some versions of the relevant operating system found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

8 participants