I'm building an image compressor. For that, I'm using the flutter image_picker package, it has a property called imageQuality which let you reduce the size of the image.
What I'm trying to achieve is that first upload the image through imagePicker and then compress it. So I can get both original and compressed sizes (before and after).
Currently what it does is compress the size while uploading/picking the image. That's what I do not want. How can I break into two steps (first upload and then compress the size using image quality parameter)
void selectImage() async {
final imagePicker = await ImagePicker().pickImage(source: ImageSource.gallery, imageQuality: 80); // upload and compress (I want to split this process)
photoSize = await getFileSize(imagePicker!.path, 1);
setState(() {
_file = File(imagePicker.path);
});
}