Skip to content

[Camera] ResolutionPreset.max is producing 4k but not camera max images #45906

Open

Description

@cputoaster

Steps to Reproduce

  1. Copy/Paste source code of camera example
  2. Modify ResolutionPreset.medium to ResolutionPreset.max
  3. Take an image and check resolution. Resolution is 3840x2160 instead of the Pixel3 standard 3024 × 4032. Also, it is compressed a lot, size is around 900KB instead of normal 3-4MB

Target Platform:
Android
Target OS version/browser:
Android 10
Devices:
Pixel 3

flutter doctor -v
[✓] Flutter (Channel dev, v1.12.15, on Mac OS X 10.15.1 19B88, locale en-CH)
    • Flutter version 1.12.15 at /Users/ameyer/flutter
    • Framework revision 459c7fb884 (6 days ago), 2019-11-26 17:04:51 +0000
    • Engine revision e136d637a8
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /Users/ameyer/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.8.4

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

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 41.1.5
    • Dart plugin version 193.5233.116

[!] VS Code (version 1.40.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • Pixel 3    • 8AUX0ZGMN  • android-arm64  • Android 10 (API 29)
    • Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.108
    • Web Server • web-server • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

Activity

  1. xxxxlr commented on Mar 8, 2020

    @xxxxlr
  2. 1996SEJR commented on Jun 10, 2020

    @1996SEJR
  3. zhuwei commented on Jul 28, 2020

    @zhuwei
  4. added
    P2Important issues not at the top of the work list
    on Jul 20, 2021
  5. TahaTesser commented on Sep 3, 2021

    @TahaTesser
    Contributor

    I can confirm the issue, when setting ResolutionPreset.max in the official example on the latest camera: ^0.9.2+2

    Android

    Native Camera p: camera

    iOS

    Native Camera
    p: camera
    stable master
    ❗️ ❗️

    Check flutter doctor -v outputs for each channel below

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5506j darwin-x64, locale en-GB)
        • Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
        • Framework revision f4abaa0735 (9 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.2
    
    [✓] 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.7621141/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.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.26.0
    
    [✓] Connected device (3 available)
        • Taha's iPhone (mobile) • 00008020-001059882212002E • ios            • iOS 15.0
        • macOS (desktop)        • macos                     • darwin-x64     • macOS 12.0 21A5506j darwin-x64
        • Chrome (web)           • chrome                    • web-javascript • Google Chrome 93.0.4577.63
    
    ! Doctor found issues in 1 category.
    [✓] Flutter (Channel master, 2.6.0-1.0.pre.170, on macOS 12.0 21A5506j darwin-x64, locale en-GB)
        • Flutter version 2.6.0-1.0.pre.170 at /Users/tahatesser/Code/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 4069c6355b (6 hours ago), 2021-09-03 02:11:05 -0400
        • Engine revision d6f6a0fe90
        • Dart version 2.15.0 (build 2.15.0-69.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.7621141/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 13.0)
        • Xcode at /Applications/Xcode-beta.app/Contents/Developer
        • CocoaPods version 1.10.2
    
    [✓] 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.7621141/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.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.26.0
    
    [✓] Connected device (3 available)
        • Taha's iPhone (mobile) • 00008020-001059882212002E • ios            • iOS 15.0 19A5340a
        • macOS (desktop)        • macos                     • darwin-x64     • macOS 12.0 21A5506j darwin-x64
        • Chrome (web)           • chrome                    • web-javascript • Google Chrome 93.0.4577.63
    
    • No issues found!

    ✅: No Issue ❗️: Issue reproduced

  6. ayberkcal commented on Dec 11, 2021

    @ayberkcal

    Is there any progress? Package is almost useless because of this bug.

  7. 11 remaining items

  8. LP0815 commented on Oct 10, 2023

    @LP0815

    For who would like to try these changes you can override the plugin package by adding:
    Thank you for the work, @tapeo !
    I have added the dependency_overrides and I am using ResolutionPreset.photo instead of ResolutionPreset.max now, but I am only getting the image in 3:4 instead of 16:9. It is still only approx. 7 MP instead of 12 MP (my app runs on the iPad Gen. 10).

    In short: I am still not able to take a photo in full resolution. Anyone else still got this problem with the flutter camera package or tapeos fork?

  9. camsim99 commented on Mar 27, 2024

    @camsim99
    Contributor

    For Android, this issue should be fixed in the CameraX implementation of the camera plugin, so please try it out!

    If you find a similar issue with that implementation (or any other issues), please feel free to file a separate issue.

  10. moved this to [PENDING] camera_android issues solved by camera_android_camerax in Android Camera Re-writeon Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencefound in release: 2.2Found to occur in 2.2found in release: 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    • Status
      [PENDING] camera_android issues solved by camera_android_camerax

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions