catch exceptions thrown at saving images
This commit is contained in:
parent
104eca5196
commit
fc058e2f05
|
@ -251,10 +251,13 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||
}
|
||||
|
||||
private val imageAvailableListener = ImageReader.OnImageAvailableListener { reader ->
|
||||
try {
|
||||
val buffer = reader.acquireNextImage().planes.first().buffer
|
||||
val bytes = ByteArray(buffer.remaining())
|
||||
buffer.get(bytes)
|
||||
PhotoProcessor(mActivity, mTargetUri, mRotationAtCapture, getJPEGOrientation(), mUseFrontCamera).execute(bytes)
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getJPEGOrientation(): Int {
|
||||
|
|
Loading…
Reference in New Issue