Status Update
Comments
xi...@google.com <xi...@google.com> #2
The comment was about the limitation of AndroidX's ExifInterface, that it can only save when the ExifInterface is File based. I updated the comment in aosp/1414308. Not sure if it worth updating the AMA answer though.
tr...@google.com <tr...@google.com> #3
Thanks for clarifying and updating the comment, Xi. My bad for assuming the reason.
To wrap up the question from the developer, there is no reason to avoid the other ExifInterface
constructors. If you need to be able to write to Exif, as the code in question is doing, you should use ExifInterface(File)
ExifInterface(String)
ExifInterface(FileDescriptor)
ExifInterface(InputStream)
sa...@gmail.com <sa...@gmail.com> #4
OK, I didn't realize that you wanted to update/override the Exif flags in of the captured Jpeg buffer. Still, it looks like there are some redundant read/write manipulations, but I am not in a position to do a code review for the CameraX source code. It was more important for me to understand the implications for my code.
Description
CameraX's Exif code mistakenly states in a comment that ExifInterface only supports File in its constructor. This was likely written in error as the ExifInterface(InputStream) constructor was only added in API 24, but the AndroidX version of ExifInterface supports the InputStream constructor. We should remove this comment to clear up confusion.