I am using CanHub image cropper in Jetpack Compose like this:
val profilePictureCropLauncher = rememberLauncherForActivityResult(
CropImageContract()
) { result ->
if (result.isSuccessful) {
profilePicturePath = result.uriContent!!
} else {
val exception = result.error
}
}
val profilePictureSelectorLauncher = rememberLauncherForActivityResult(
ActivityResultContracts.GetContent()
) { uri ->
profilePictureCropLauncher.launch(
CropImageContractOptions(
uri,
CropImageOptions(
fixAspectRatio = true,
outputCompressFormat = Bitmap.CompressFormat.PNG
)
)
)
}
...
...
profilePictureSelectorLauncher.launch("image/*")
Where I first select an image from gallery/camera, then pass it to the CanHub cropping activity. However, in the crop activity, there is no button to confirm the crop.
Is there some code I'm missing? Thanks