mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-16 19:30:40 +01:00
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 ->
|
private val imageAvailableListener = ImageReader.OnImageAvailableListener { reader ->
|
||||||
val buffer = reader.acquireNextImage().planes.first().buffer
|
try {
|
||||||
val bytes = ByteArray(buffer.remaining())
|
val buffer = reader.acquireNextImage().planes.first().buffer
|
||||||
buffer.get(bytes)
|
val bytes = ByteArray(buffer.remaining())
|
||||||
PhotoProcessor(mActivity, mTargetUri, mRotationAtCapture, getJPEGOrientation(), mUseFrontCamera).execute(bytes)
|
buffer.get(bytes)
|
||||||
|
PhotoProcessor(mActivity, mTargetUri, mRotationAtCapture, getJPEGOrientation(), mUseFrontCamera).execute(bytes)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getJPEGOrientation(): Int {
|
private fun getJPEGOrientation(): Int {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user