I need to take photo using system camera application. My simplified code looks like this:
@Composable
fun takePhoto(){
val cameraLauncher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.TakePicture(),
onResult = { success -> ... }
)
...
if (hasCamPermission) {
val uri = ComposeFileProvider.getImageUri(context)
imageUri = uri
cameraLauncher.launch(uri)
}
But I want to compress resulted photo. Is there any way to request photo of certain size or I need to do it manually? What is the best way to do it?