mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Fix crash when editing image
This commit is contained in:
parent
b8eeede5fd
commit
b5a402c1e1
@ -201,7 +201,9 @@ class AttachmentsPreviewFragment @Inject constructor(
|
||||
private fun doHandleEditAction() = withState(viewModel) {
|
||||
val currentAttachment = it.attachments.getOrNull(it.currentAttachmentIndex) ?: return@withState
|
||||
val destinationFile = File(requireContext().cacheDir, "${currentAttachment.name}_edited_image_${System.currentTimeMillis()}")
|
||||
UCrop.of(currentAttachment.queryUri.toUri(), destinationFile.toUri())
|
||||
// Note: using currentAttachment.queryUri.toUri() make the app crash when sharing from Google Photos
|
||||
val uri = File(currentAttachment.path).toUri()
|
||||
UCrop.of(uri, destinationFile.toUri())
|
||||
.withOptions(
|
||||
UCrop.Options()
|
||||
.apply {
|
||||
|
Loading…
Reference in New Issue
Block a user