Good evening, I have an application that takes pictures and brings them from the gallery, I can take the photo and I save it in a URI as well as the image I bring from the gallery, now my question is, how do I create a bitmap with the same image but compressed and also save it in another direction, then when I take them to the server I take them separately, then I carry the image in full size and the compressed image
This I want to do to achieve what is called thumbnail, then when loading the photos first charge the first and then charge the full size
if (requestCode == 1 && resultCode == Activity.RESULT_OK) {
mImageUri = data.getData();
CropImage.activity(mImageUri)
.setGuidelines(CropImageView.Guidelines.ON)
.setAspectRatio(1, 1)
.start(getContext(), this);
mUploadBtn.setImageURI(mImageUri);
}
if (requestCode == 2) {
mImageUri = data.getData();
CropImage.activity(mImageUri)
.setGuidelines(CropImageView.Guidelines.ON)
.setAspectRatio(1, 1)
.start(getContext(), this);
mUploadBtn.setImageURI(mImageUri);
}
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == Activity.RESULT_OK) {
mImageUri = result.getUri();
mUploadBtn.setImageURI(mImageUri);
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Exception error = result.getError();
}
}
}
Here I save the image taken from both the camera and the gallery in my mImageUri, now, I want to save the same image in a bitmap but compressed by 90%, that is to say that instead of having an mImageUri, I should also have something Call for example mImageCompress
Thanks