fix #643, properly handle saving edited images with file uri
This commit is contained in:
parent
316c8fc85d
commit
a10fd3e876
1 changed files with 20 additions and 16 deletions
|
@ -144,6 +144,9 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
||||
if (result.error == null) {
|
||||
if (isCropIntent) {
|
||||
if (saveUri.scheme == "file") {
|
||||
saveBitmapToFile(result.bitmap, saveUri.path)
|
||||
} else {
|
||||
var inputStream: InputStream? = null
|
||||
var outputStream: OutputStream? = null
|
||||
try {
|
||||
|
@ -162,6 +165,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
setResult(RESULT_OK, this)
|
||||
}
|
||||
finish()
|
||||
}
|
||||
} else if (saveUri.scheme == "file") {
|
||||
SaveAsDialog(this, saveUri.path, true) {
|
||||
saveBitmapToFile(result.bitmap, it)
|
||||
|
|
Loading…
Reference in a new issue