1
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
        CropImage.ActivityResult result = CropImage.getActivityResult(data);
        if (resultCode == RESULT_OK) {
            imageUri = result.getUri();
            storageReference.putFile(imageUri);
        }
    }
}

How to compress image from Uri? I don't want to compress it to Bitmap or store on device and retrieve from there. Is there any other way?

aminography
  • 21,986
  • 13
  • 70
  • 74
Detained Developer
  • 1,134
  • 2
  • 13
  • 33
  • 2
    As we know, Uri refers to a resource. In addition, there is no way to compress an image without bringing it to the memory. So you should bring the image to memory, do a compression task and save it to storage. Look at https://stackoverflow.com/questions/13859769/how-to-compress-uri-image-to-bitmap – aminography Oct 11 '18 at 21:00
  • Thank you, @aminography – Detained Developer Oct 12 '18 at 13:23

0 Answers0