mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix #643, properly handle saving edited images with file uri
This commit is contained in:
@ -144,6 +144,9 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||||||
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
||||||
if (result.error == null) {
|
if (result.error == null) {
|
||||||
if (isCropIntent) {
|
if (isCropIntent) {
|
||||||
|
if (saveUri.scheme == "file") {
|
||||||
|
saveBitmapToFile(result.bitmap, saveUri.path)
|
||||||
|
} else {
|
||||||
var inputStream: InputStream? = null
|
var inputStream: InputStream? = null
|
||||||
var outputStream: OutputStream? = null
|
var outputStream: OutputStream? = null
|
||||||
try {
|
try {
|
||||||
@ -162,6 +165,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||||||
setResult(RESULT_OK, this)
|
setResult(RESULT_OK, this)
|
||||||
}
|
}
|
||||||
finish()
|
finish()
|
||||||
|
}
|
||||||
} else if (saveUri.scheme == "file") {
|
} else if (saveUri.scheme == "file") {
|
||||||
SaveAsDialog(this, saveUri.path, true) {
|
SaveAsDialog(this, saveUri.path, true) {
|
||||||
saveBitmapToFile(result.bitmap, it)
|
saveBitmapToFile(result.bitmap, it)
|
||||||
|
Reference in New Issue
Block a user