compress method
Compressing image into supported format
Implementation
Future<ic.ImageFile> compress(HcImageFileConfiguration param) async {
return await dummyCallNativeCode(
'compress',
param.toMap(),
() {
switch (param.config.outputType) {
case HcImageOutputType.webpThenJpg:
return compressWebpThenJpg(param);
case HcImageOutputType.webpThenPng:
return compressWebpThenPng(param);
case HcImageOutputType.jpg:
return compressJpg(param);
case HcImageOutputType.png:
return compressPng(param);
}
},
);
}