Status Update
Comments
wu...@google.com <wu...@google.com>
ch...@google.com <ch...@google.com> #2
li...@gmail.com <li...@gmail.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
li...@gmail.com <li...@gmail.com> #4
Hi,
Thank you very much.
I found the issue happen on Samsung devices with "Ultra". It work well on ther devices.
I download the CameraXBasic-ForceAspectRatio_16_9.apk and take a picture.I got an image(4000x2252) with EXIF info.The source captured image's resolution is 4000x2252.
I found I bind the use cases with UseCaseGroup which has ViewPort setting.This lead to output image is cropped from the source captured image.Finally I got an image(4000x2250) without EXIF info.
How can I get the EXIF info in this case? Should I do not set UseCaseGroup with ViewPort setting? May be I should get the source captured image and crop it by myself.
Thank you very much!!
ch...@google.com <ch...@google.com> #5
Hi Xi,
When using ViewPort, is it possible not to crop the output image?
Hi 675683354,
We will also study how to preserve the exif data when cropping the output image.
li...@gmail.com <li...@gmail.com> #6
xi...@google.com <xi...@google.com> #7
By design, the exif should be preserved regardless of cropping. If that's not the case, it might be a bug/quirk. Please see the following code pointer. Both the image and the original exif are saved:
sc...@google.com <sc...@google.com> #8
Hi Xi,
I've checked the codes, it look like ImageUtil.imageToJpegByteArray(Image) will remove the EXIF if cropping is performed.
ImageUtil.cropByteArray is invoked to do the cropping and it actually generate a cropped Bitmap and then call bitmap.compress to generate the jpeg byte data. This is probably the reason why EXIF is not preserved.
And in ImageSaver, we extract the exif from the temp file whose byte data is ImageUtil.imageToJpegByteArray. and we only update orientation in the EXIF.
I think we should either fix ImageUtil.imageToJpegByteArray to make it contain EXIF Or we can fix the ImageSaver to copy the EXIF from IMAGE to the temp file.
er...@google.com <er...@google.com> #9
Hi Xi - can you please take a look? Thanks
xi...@google.com <xi...@google.com> #10
If I am not mistaken, we do extract the exif from the original bytes
Do we want to copy all the data? Looks like it's non-trivial. See
xi...@google.com <xi...@google.com>
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit 52696159ed05bf76489e7b04bf110eb4ef37e493
Author: Xi Zhang <xizh@google.com>
Date: Thu Jul 22 15:04:32 2021
Bugfix: copy exif info from the original image to the cropped image.
- Upgrade ExifInterface dependency to 1.3.2 to get more Exif tags.
- In ImageSaver, copy all 150+ exif tag data to the new image, except for the 10 tags related to dimension and thumbnail
Relnote: add the Exif info to the captured image.
Bug: 193342619
Test: manual test and ./gradlew bOS
Change-Id: I01ff0014f5124fc265ead5816789f41047e43cac
M camera/camera-core/build.gradle
M camera/camera-core/src/androidTest/java/androidx/camera/core/ImageSaverTest.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageSaver.java
M camera/camera-core/src/main/java/androidx/camera/core/impl/utils/Exif.java
Description
Please describe your issue and include details such as the version of CameraX you are using and any relevant logs related to your issue.
// If at all possible, capture an Android logcat (
CAMERAX VERSION (ex - 1.1.0-alpha06)
CAMERA APPLICATION NAME AND VERSION: (Settings > Apps > (app name) > version)
ANDROID OS BUILD NUMBER: (Settings > About > Build number)
DEVICE NAME: (Nexus 5X, Samsung S6, etc)
Samsung Note20 Ultra 5G
Samsung Galaxy S20 Ultra 5G
Samsung Galaxy S21 Ultra 5G
DESCRIPTION:
There is no EXIF infomation when I take picture on Samsung Note20 Ultra.
About the ImageCapture,I set target aspect ratio 16:9.
Finally i got an image(4000x2250) ,it have not EXIF information.
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
STEPS TO REPRODUCE:
1.ImageCapture.Builder.setTargetAspectRatio(AspectRatio.RATIO_16_9)
2.ImageCapture.takePicture()
3.Get an output Image There have no EXIF infomation
OBSERVED RESULTS:
The output image has no EXIF imformation.
EXPECTED RESULTS:
The output image has EXIF imformation.
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
ADDITIONAL INFORMATION:
CODE FRAGMENTS (this will help us troubleshoot your issues):