1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
Future<Uint8List> testCompressFile(File file) async { var result = await FlutterImageCompress.compressWithFile( file.absolute.path, minWidth: 2300, minHeight: 1500, quality: 94, rotate: 90, ); print(file.lengthSync()); print(result.length); return result; }
Future<File> testCompressAndGetFile(File file, String targetPath) async { var result = await FlutterImageCompress.compressAndGetFile( file.absolute.path, targetPath, quality: 88, rotate: 180, );
print(file.lengthSync()); print(result.lengthSync());
return result; }
Future<Uint8List> testCompressAsset(String assetName) async { var list = await FlutterImageCompress.compressAssetImage( assetName, minHeight: 1920, minWidth: 1080, quality: 96, rotate: 180, );
return list; }
Future<Uint8List> testComporessList(Uint8List list) async { var result = await FlutterImageCompress.compressWithList( list, minHeight: 1920, minWidth: 1080, quality: 96, rotate: 135, ); print(list.length); print(result.length); return result; }
|