catch and show exceptions thrown at Editor filtering

This commit is contained in:
tibbi 2019-03-09 23:25:56 +01:00
parent 804eb08143
commit 8290f43282

View file

@ -583,7 +583,14 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
val thumbnailSize = resources.getDimension(R.dimen.bottom_filters_thumbnail_size).toInt()
val bitmap = Glide.with(this)
.asBitmap()
.load(uri)
.load(uri).listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
showErrorToast(e.toString())
return false
}
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean) = false
})
.submit(thumbnailSize, thumbnailSize)
.get()