Status Update
Comments
th...@gmail.com <th...@gmail.com> #2
ch...@google.com <ch...@google.com>
ch...@google.com <ch...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
th...@gmail.com <th...@gmail.com> #4
Thanks for the response.
Just to confirm all of the steps:
-
I've run
CameraXBasic
sample, and that's how the app behaves on SNE-LX1 (see video step_1.mov). -
I've changed the
scaleType
property forPreviewView
tofitCenter
, and makeaspectRatio(width:height:)
method to always returnAspectRatio.RATIO_4_3
. The result is in step_2.mov. -
I've added the following part of code after photo is taken:
val exif = ExifInterface(photoFile.absolutePath).apply { setAttribute( ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_ROTATE_90.toString() ) } exif.saveAttributes()
and it works fine. You can see the result in step_3.mov.
Answering your questions:
- The output image seems to be fine, not cropped.
- Exactly. I don't have access to Honor 9X device, but this is the output from
- Brand:Sentry HONOR
, Model:STK-LX1 (HUAWEISTK-LX1)
(the(HUAWEISTK-LX1)
part is added by Sentry, rather than it's clear output fromBuild.MODEL
). - The device I've borrowed has API 29. The users that have reported the issue had also devices with API 28.
- The device I've borrowed - yes. I assume that the other devices had also GMS apps installed.
ch...@google.com <ch...@google.com> #5
Thanks for providing the detailed information.
About the 3rd question, could you help to check the camera device hardware level but not the Android API level? The code in Java may look like the following:
CameraManager cameraManager =
(CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraId);
int hardwareLevel = characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
I want to confirm the camera device HW level is because that one CTS test should have checked the captured image's EXIF orientation value. But it only tested non-Legacy devices. Non-Legacy devices shouldn't encounter this issue. Therefore, I want to confirm the Huawei Mate 20 Lite and the Honor 9X's HW level to confirm the issue root cause is the same as what I supposed to. Thanks.
th...@gmail.com <th...@gmail.com> #6
Oh, sorry, I misunderstood.
So for the Huawei Mate 20 Lite the camera device HW level is 0 (INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
). Unfortunately I'm unable to check the value for Honor 9X easily, but if it's necessary just let me know (I think it will take a few weeks, cause I need to log this info in the production level app).
ch...@google.com <ch...@google.com> #7
Thanks.
Could you also help to provide the Build.DEVICE
info of these two devices? Thanks.
th...@gmail.com <th...@gmail.com> #8
For Huawei Mate 20 Lite it's HWSNE
. Unfortunately, I'm unable to provide you info for Honor 9X.
ch...@google.com <ch...@google.com> #9
Hi,
We're clarifying this issue with the camera framework team and need your further help to provide some more information. So that we can know all the details and might be able to improve the CTS tests to cover this in the future.
- What is the problematic image size when capturing the image in target aspect ratio 4:3 setting?
- Could you help to provide the JPEG supported sizes list of the Huawei Mate 20 Lite device? I'm not sure whether it is the same as you have been provided in
.b/161156062#comment4 - Could you provide a bugreport that is dumped right after operating to capture the problematic 4:3 image?
Thanks in advance.
th...@gmail.com <th...@gmail.com> #10
Hi,
- I didn't specify target resolution, but I've check with max available resolution (3840x5120) and custom one (1200x1600), both times the issue has occurred.
- Yes, it is the same list I've provided.
- In attachments.
Please let me know when you will have any plans to cover this issue.
ch...@google.com <ch...@google.com> #11
Thanks. This issue will be targeted to be fixed in Dec release.
th...@gmail.com <th...@gmail.com> #12
Thank you. I'm looking forward to it.
ch...@google.com <ch...@google.com> #13
Hi,
Could you help to install and check whether the issue can be resolved by the attached apk?
What I modified:
- Force CameraFragment#aspectRatio() to return AspectRatio.RATIO_4_3.
- Do not use JPEG_ORIENTATION capture request parameter and rotate the output image according the target rotation setting. This is only applied to the Huawei Mate 20 Lite and Honor 9X devices by Build.BRAND and Build.MODEL.
Please take pictures in 0, 90 and 180 and also help to dump and extract logs with tag "b171492111-debug". So that I can analyze whether the solution work as expectation.
Thanks.
wu...@google.com <wu...@google.com> #14
Friendly ping :)
ma...@shelfwise.ai <ma...@shelfwise.ai> #15
Sorry for the delay, I was trying to borrow the Huawei device again. Unfortunately I'm unable to get this device in next few weeks. Does it stop the fix from being added to library?
Best.
ch...@google.com <ch...@google.com> #16
Hi,
It won't stop the fix. The purpose is just to verify my solution can really resolve the problem since I do not have device to verify it. I'll still prepare the fix in the next release.
ap...@google.com <ap...@google.com> #17
Branch: androidx-master-dev
commit 5995a6a42d1bddfa42276d2c7c730605624fa84b
Author: charcoalchen <charcoalchen@google.com>
Date: Thu Oct 29 15:44:03 2020
Fixed orientation issue when capturing 4:3 images on some devices.
1. Add ImageCapture capture option quirk to not use CaptureRequest.JPEG_ORIENTATION on some devices. (On some devices, the orientation value in the embedded exif of the captured images may be 0 but the image buffer data actually is not rotated to upright orientation by HAL.)
2. For those devices, we can't use CaptureRequest.JPEG_ORIENTATION parameter and need to set the orientation value according to the target rotation setting.
Relnote:"Fixed orientation issue when capturing 4:3 images on some devices."
Bug: 171492111
Test: ./gradlew bOS
Change-Id: I0e3fb7705daeb5b8caa98e80215a545f8a3ca484
M camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageSaver.java
M camera/camera-core/src/main/java/androidx/camera/core/internal/compat/quirk/DeviceQuirksLoader.java
A camera/camera-core/src/main/java/androidx/camera/core/internal/compat/quirk/ImageCaptureRotationOptionQuirk.java
A camera/camera-core/src/main/java/androidx/camera/core/internal/compat/workaround/ExifRotationAvailability.java
A camera/camera-core/src/main/java/androidx/camera/core/internal/compat/workaround/package-info.java
A camera/camera-core/src/test/java/androidx/camera/core/internal/compat/quirk/ImageCaptureRotationOptionQuirkTest.java
A camera/camera-core/src/test/java/androidx/camera/core/internal/compat/workaround/ExifRotationAvailabilityTest.java
ch...@google.com <ch...@google.com> #18
th...@gmail.com <th...@gmail.com> #19
Hi,
Great news, it works on real users' devices. Thank you for resolving this.
Description
CAMERAX VERSION: 1.0.0-beta10
DEVICE NAME: Huawei Mate 20 Lite
DESCRIPTION:
Originally I've opened issue here .
Some of the users have reported that their photos are cropped and rotated. I've noticed that all of them have the same devices, i.a. Huawei Mate 20 Lite (SNE-LX1), Honor 9X (STK-LX1).
I couldn't reproduce the issue on my devices, that's why the previous issue has been closed, but I have finally managed to borrow Huawei Mate 20 Lite and test it.
The reproduction steps are very easy, just download the official CameraXBasic Sample , force the app to always use AspectRatio.RATIO_4_3 and run on a affected device (or maybe this is not an easy step). The result is that the photos are cropped and rotated (see the attachment).