android / android/camera-samples

Do we need to set up targetResolution based on orientation?

Open
#470 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
5.5k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

In the [docs](https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis.Builder#setTargetResolution(android.util.Size)), it says the following:

The resolution [Size](https://developer.android.com/reference/android/util/Size.html) should be expressed in the coordinate frame after rotating the supported sizes by the target rotation. For example, a device with portrait natural orientation in natural target rotation requesting a portrait image may specify 480x640, and the same device, rotated 90 degrees and targeting landscape orientation may specify 640x480.

So do we need to switch width and height based on orientation like this: https://gist.github.com/ldstein/bf8b88fabc27617dca891aa3be58f9d7

I cannot find an official example.

Contributor guide

Open the contributing guide

Research direction

Start with the linked ImageAnalysis.Builder#setTargetResolution documentation and compare its orientation guidance with the camera sample code; the issue does not name a file or test. Done means documenting the expected width and height handling, ideally with an official sample or a precise reference for the relevant configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
documentation, mobile
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.