An image compress package like Luban for Dart, based on image.This library has no system platform constraints.
If toJpg: true , it supports all readable image formats
CompressObject compressObject =CompressObject(
imageFile:imageFile, //image
path:tempDir.path, //compress to path
useCache:true, //If there is a cache, no compression will be performed
toJpg:true, //Convert the image to jpg
);
Luban.compressImage(compressObject).then((_path) {
setState(() {
print(_path);
});
});