压缩图像
当前项目代码仓暂无内容
fast_image_compress
本项目基于 fast_image_compress 开发。
1. 安装与使用
1.1 安装方式
进入到工程目录并在 pubspec.yaml 中添加以下依赖:
pubspec.yaml
...
dependencies:
fluttertpc_fast_image_compress:
git:
url: https://gitcode.com/CPF-Flutter/fluttertpc_fast_image_compress
# ref: 根据下方表格选择不同框架适配的TAG版本
ref: x.x.x-ohos-x.x.x-betax
...
执行命令
flutter pub get
| Flutter 框架版本 | TAG 名称 | 分支名 |
|---|---|---|
| 3.22 | 0.0.3-ohos-1.0.0-beta.1 | master |
| 3.27 | 0.0.3-ohos-1.0.0-beta.1 | master |
1.2 使用案例
使用案例详见 example
2. 约束与限制
2.1 兼容性
在以下版本中已测试通过
- Flutter: 3.22.1-ohos-1.0.6; SDK: 5.0.0(12); IDE: DevEco Studio: 6.0.0.858; ROM: 6.0.0.120 SP6;
- Flutter: 3.27.5-ohos-1.0.0; SDK: 5.0.0(12); IDE: DevEco Studio: 6.0.0.858; ROM: 6.0.0.120 SP6;
3. API
"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 Android 的效果。
RSA
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| compressImage | 压缩单个图像 | function | Uint8List imageData,int quality,int? targetWidth,ImageQuality imageQuality | Future<Uint8List?> | yes |
| compressImageList | 批量压缩图像列表 | function | List images,int quality,int? targetWidth,int batchSize,ImageQuality imageQuality | Future<List> | yes |
| cancelCompression | 取消正在压缩的图像进程 | function | Future | yes |
4. 遗留问题
无
5. 开源协议
本项目基于 The MIT License,请自由地享受和参与开源。