mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47: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()
|
bottom_actions_filter_list.beGone()
|
||||||
|
|
||||||
Thread {
|
Thread {
|
||||||
val originalBitmap = Glide.with(applicationContext).asBitmap().load(uri).submit(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get()
|
try {
|
||||||
currentFilter.filter.processFilter(originalBitmap)
|
val originalBitmap = Glide.with(applicationContext).asBitmap().load(uri).submit(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get()
|
||||||
saveBitmapToFile(originalBitmap, it, false)
|
currentFilter.filter.processFilter(originalBitmap)
|
||||||
|
saveBitmapToFile(originalBitmap, it, false)
|
||||||
|
} catch (e: OutOfMemoryError) {
|
||||||
|
toast(R.string.out_of_memory_error)
|
||||||
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue