catch out of memory errors at saving images with filters
This commit is contained in:
parent
84a13be72f
commit
8c72bebe72
|
@ -228,9 +228,13 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
bottom_actions_filter_list.beGone()
|
||||
|
||||
Thread {
|
||||
val originalBitmap = Glide.with(applicationContext).asBitmap().load(uri).submit(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get()
|
||||
currentFilter.filter.processFilter(originalBitmap)
|
||||
saveBitmapToFile(originalBitmap, it, false)
|
||||
try {
|
||||
val originalBitmap = Glide.with(applicationContext).asBitmap().load(uri).submit(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get()
|
||||
currentFilter.filter.processFilter(originalBitmap)
|
||||
saveBitmapToFile(originalBitmap, it, false)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
toast(R.string.out_of_memory_error)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue