execCompressed method
void
execCompressed()
Implementation
void execCompressed() async {
var imageMap = await uncompressedImage;
if (imageMap.isEmpty) {
print("execCompressed => 没有需要压缩的文件");
return;
}
print("execCompressed => 需要压缩的文件:");
for (var image in imageMap.values) {
print(image.file.path);
}
for (var image in imageMap.values) {
AKTinyCompressedResult result = await image.doCompressed();
if (result.downloadResult == null || result.downloadResult!.statusCode != 200) {
return;
}
if (image.uiqId != null) {
readUIQIds().add(File(image.file.path).uiqid);
}
}
print("execCompressed => 保存压缩后的图片的md5值文件路径:${uiqIdFile?.path}");
uiqIdFile?.writeAsStringSync(jsonEncode(List<String>.from(readUIQIds())));
}