6

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.

Nominalista
  • 4,632
  • 11
  • 43
  • 102
  • did you try to set setTargetRotation together with setTargetResolution? – YMY May 20 '20 at 11:22
  • I did and unfortunately it doesn't work. – Nominalista Jul 14 '20 at 08:17
  • @Nominalista Instead of block list, can you do something like inverse devices list, and for those you provide resolution parameters already inverted so those device will invert it again and get it right. what say? – NotABot Jul 20 '20 at 19:50
  • It could work, but I don't have access to all devices from Signal blacklist. I assume I would have to expand the device list sequentially when I noticed that real users had experienced this issue. – Nominalista Jul 21 '20 at 06:32

0 Answers0