Fixed
Status Update
Comments
er...@google.com <er...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
xi...@google.com <xi...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
er...@google.com <er...@google.com>
sa...@withpersona.com <sa...@withpersona.com> #4
No, I was using the OutputFileOptions.Builder#Builder(java.io.File) from
yourhttps://github.com/android/camera-samples example.
I stopped reading here.
public interface OnImageSavedCallback {
/** Called when an image has been successfully saved. */
void onImageSaved(@NonNull OutputFileResults outputFileResults);
// ...
}
Are you planning on changing the behavior of
OnImageSavedCallback#onImageSaved so that all of the builders are treated
the same way? I was surprised that only one of the three OutputFileOptions
make OutputFileResults useable.
On Mon, Feb 10, 2020 at 5:23 PM <buganizer-system@google.com> wrote:
your
I stopped reading here.
public interface OnImageSavedCallback {
/** Called when an image has been successfully saved. */
void onImageSaved(@NonNull OutputFileResults outputFileResults);
// ...
}
Are you planning on changing the behavior of
OnImageSavedCallback#onImageSaved so that all of the builders are treated
the same way? I was surprised that only one of the three OutputFileOptions
make OutputFileResults useable.
On Mon, Feb 10, 2020 at 5:23 PM <buganizer-system@google.com> wrote:
xi...@google.com <xi...@google.com> #5
The API works that way because the only saved location generated by CameraX is the URI one. For File, you should already have the save location. Is there a reason you also want it in the callback?
sa...@withpersona.com <sa...@withpersona.com> #6
The API works that way because the only saved location generated by CameraX
is the URI one.
My personal opinion is that I don't like having to know the underlying
implementation in order to use the API properly.
For File, you should already have the save location. Is there a reason you
also want it in the callback?
From an API usability perspective, if you always return the file in the
OnImageSavedCallback, you can build the OutputFileOptions three different
ways and use the same OnImageSavedCallback for each of them.
Additionally, if the OnImageSavedCallback can give me a reference to the
file (or URI), it's one less thing for me to have to keep track of and one
less place where I have to worry about messing up. If I don't get the file
in the callback, I need to add logic to combine the OnImageSavedCallback
with the file, and that's super easy to get wrong.
On Tue, Feb 11, 2020 at 11:09 AM <buganizer-system@google.com> wrote:
is the URI one.
My personal opinion is that I don't like having to know the underlying
implementation in order to use the API properly.
For File, you should already have the save location. Is there a reason you
also want it in the callback?
From an API usability perspective, if you always return the file in the
OnImageSavedCallback, you can build the OutputFileOptions three different
ways and use the same OnImageSavedCallback for each of them.
Additionally, if the OnImageSavedCallback can give me a reference to the
file (or URI), it's one less thing for me to have to keep track of and one
less place where I have to worry about messing up. If I don't get the file
in the callback, I need to add logic to combine the OnImageSavedCallback
with the file, and that's super easy to get wrong.
On Tue, Feb 11, 2020 at 11:09 AM <buganizer-system@google.com> wrote:
sa...@withpersona.com <sa...@withpersona.com> #7
It looks like all of my text styling is getting stripped out from the bug
tracker.
On Tue, Feb 11, 2020 at 3:02 PM Salvatore Testa <sal@withpersona.com> wrote:
tracker.
On Tue, Feb 11, 2020 at 3:02 PM Salvatore Testa <sal@withpersona.com> wrote:
er...@google.com <er...@google.com> #8
Hi Sal,
Thanks for the feedback - we'll keep this in mind for the future - but short term this behavior will remain as Xi describes. We'll consider this when updating to a future version of the API. Thanks
fu...@google.com <fu...@google.com>
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit c070c851c5d1c343fb701d90ffb94ffb22afd5d1
Author: Xi Zhang <xizh@google.com>
Date: Tue Jul 13 10:31:20 2021
Behavior change: fill the uri field when saving to File
Relnote: In ImageCapture, return the URI of the saved image if the saving location is File.
Bug: 149241379
Test: manual test and ./gradlew bOS
Change-Id: Ib5b49b6b3555503b12f7461f6eca8f4407cab636
M camera/camera-core/src/androidTest/java/androidx/camera/core/ImageSaverTest.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageSaver.java
https://android-review.googlesource.com/1764791
Branch: androidx-main
commit c070c851c5d1c343fb701d90ffb94ffb22afd5d1
Author: Xi Zhang <xizh@google.com>
Date: Tue Jul 13 10:31:20 2021
Behavior change: fill the uri field when saving to File
Relnote: In ImageCapture, return the URI of the saved image if the saving location is File.
Bug: 149241379
Test: manual test and ./gradlew bOS
Change-Id: Ib5b49b6b3555503b12f7461f6eca8f4407cab636
M camera/camera-core/src/androidTest/java/androidx/camera/core/ImageSaverTest.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
M camera/camera-core/src/main/java/androidx/camera/core/ImageSaver.java
Description
CAMERAX VERSION 1.0.0-alpha10
CAMERA APPLICATION NAME AND VERSION: (Settings > Apps > (app name) > version)
ANDROID OS BUILD NUMBER: sdk_google_phone_x86-eng 5.0.2 LSY66K 5523115 test-keys
DEVICE NAME: sdk_google_phone_x86 (I also had the issue on my Pixel 4XL)
DESCRIPTION:
STEPS TO REPRODUCE:
1. Clone my modified version of `camera-samples`
```
git clone git@github.com:SalvatoreT/camera-samples.git
```
2. Run the app in Android Studio.
3. Take a photo.
OBSERVED RESULTS:
You'll see the following in logcat.
```
FATAL EXCEPTION: main
Process: com.android.example.cameraxbasic, PID: 6623
kotlin.KotlinNullPointerException
at com.android.example.cameraxbasic.fragments.CameraFragment$imageSavedListener$1.onImageSaved(CameraFragment.kt:196)
at androidx.camera.core.ImageCapture$2.onImageSaved(ImageCapture.java:642)
at androidx.camera.core.ImageSaver$1.run(ImageSaver.java:242)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
```
EXPECTED RESULTS: Not a crash.
REPRODUCIBILITY: every time
CODE FRAGMENTS: Here are the changes I made.