Let's say we want to capture only portrait (not landscape) photos with the target resolution of 1200x1600
pixels.
According to the documentation of setTargetResolution
method in ImageCapture.Builder
:
The resolution should be expressed at the use cases's 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.
we should build ImageCapture
use case like that:
ImageCapture.Builder()
.setTargetResolution(Size(1200, 1600))
.build()
Let's assume we have always our phone in a portrait natural orientation.
Everything works fine excepts on some Huawei phones (e.g. Huawei Mate 20 Lite) the image is cropped as we would inverse the size dimensions (i.e. Size(1600,1200)
).
Is there any "safe" workaround that we could use to solve this issue? I would not prefer to blacklist the Huawei devices like a Signal does.
CameraX version 1.0.0-beta03
.
Edit
1.0.0-beta06
still not working.