mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
catch out of memory errors at saving images with filters
This commit is contained in:
parent
84a13be72f
commit
8c72bebe72
1 changed files with 7 additions and 3 deletions
|
@ -228,9 +228,13 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
bottom_actions_filter_list.beGone()
|
||||
|
||||
Thread {
|
||||
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 a new issue