Commit 61b9b1e 1 parent e0f8411 commit 61b9b1e Copy full SHA for 61b9b1e
File tree 1 file changed +7
-17
lines changed
app/src/main/java/app/grapheneos/camera/capturer
1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -81,26 +81,16 @@ class ImageSaver(
81
81
}
82
82
83
83
override fun onCaptureSuccess (image : ImageProxy ) {
84
- mainThreadExecutor.execute mainExecutor@ {
85
- if (isCancelled) return @mainExecutor
86
-
87
- imageCaptureCallbackExecutor.execute iccExecutor@ {
88
- try {
89
- extractJpegBytes(image)
90
- } catch (e: Exception ) {
91
- handleError(ImageSaverException (Place .IMAGE_EXTRACTION , e))
92
- return @iccExecutor
93
- }
94
-
95
- imageWriterExecutor.execute(this ::saveImage)
96
- }
84
+ mainThreadExecutor.execute(imageCapturer::onCaptureSuccess)
97
85
98
- imageCapturer.onCaptureSuccess()
86
+ try {
87
+ extractJpegBytes(image)
88
+ } catch (e: Exception ) {
89
+ handleError(ImageSaverException (Place .IMAGE_EXTRACTION , e))
90
+ return
99
91
}
100
92
101
-
102
-
103
-
93
+ imageWriterExecutor.execute(this ::saveImage)
104
94
}
105
95
106
96
// based on androidx.camera.core.ImageSaver#imageToJpegByteArray(),
You can’t perform that action at this time.
0 commit comments