'is there a proper way to compress image
#This is the function from which i select multiple image from gallery and add it to my own list that is imageFileList
final ImagePicker imagePicker = ImagePicker();
List<File> imageFileList=[];
String images;
void selectImages() async {
List<XFile> selectedImages = await imagePicker.pickMultiImage(imageQuality:5);
if (selectedImages != null) {
for(int i=0;i<selectedImages.length;i++) {
imageFileList.add(File(selectedImages[i].path));
}
#everything works fine but the problem is that i want to compress. Meaning the image which i pick from gallery first i want to get its size and if its size is greater than 40mb or 20mb or 15mb.. then i want to reduce to 5 mb or even to kb by keeping the quality of image and if the image is already in kb i dont want to compress it. i want to achieve it something like this but i am little confused on how to achieve that and add it to my imageFileList. Need some help thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
