Commit 0265c1ae authored by Syan's avatar Syan

v0.3.7

parent d1ba0ba6
......@@ -200,6 +200,11 @@ showCropGrid | bool | 是 | false | 是否隐藏裁剪区域网格
quality | int | 是 | 90 | 压缩质量(安卓无效,固定鲁班压缩)
minimumCompressSize | int | 是 | 100 | 小于100kb的图片不压缩(Android)
enableBase64 | bool | 是 | false | 是否返回base64编码,默认不返回
freeStyleCropEnabled | bool | 是 | false | 裁剪框是否可拖拽(Android)
rotateEnabled | bool | 是 | true | 裁剪是否可旋转图片(Android)
scaleEnabled | bool | 是 | true | 裁剪是否可放大缩小图片(Android)
## 返回结果说明
以 `Callback` 形式调用时,返回的第一个参数为错误对象,第二个才是图片数组:
......
......@@ -154,6 +154,9 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
boolean showCropFrame = this.cameraOptions.getBoolean("showCropFrame");
boolean showCropGrid = this.cameraOptions.getBoolean("showCropGrid");
boolean compress = this.cameraOptions.getBoolean("compress");
boolean freeStyleCropEnabled = this.cameraOptions.getBoolean("freeStyleCropEnabled");
boolean rotateEnabled = this.cameraOptions.getBoolean("rotateEnabled");
boolean scaleEnabled = this.cameraOptions.getBoolean("scaleEnabled");
int minimumCompressSize = this.cameraOptions.getInt("minimumCompressSize");
int quality = this.cameraOptions.getInt("quality");
......@@ -183,7 +186,7 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
.withAspectRatio(CropW, CropH)// int 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
.hideBottomControls(isCrop)// 是否显示uCrop工具栏,默认不显示 true or false
.isGif(isGif)// 是否显示gif图片 true or false
.freeStyleCropEnabled(true)// 裁剪框是否可拖拽 true or false
.freeStyleCropEnabled(freeStyleCropEnabled)// 裁剪框是否可拖拽 true or false
.circleDimmedLayer(showCropCircle)// 是否圆形裁剪 true or false
.showCropFrame(showCropFrame)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false
.showCropGrid(showCropGrid)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
......@@ -191,8 +194,8 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
.cropCompressQuality(quality)// 裁剪压缩质量 默认90 int
.minimumCompressSize(minimumCompressSize)// 小于100kb的图片不压缩
.synOrAsy(true)//同步true或异步false 压缩 默认同步
.rotateEnabled(true) // 裁剪是否可旋转图片 true or false
.scaleEnabled(true)// 裁剪是否可放大缩小图片 true or false
.rotateEnabled(rotateEnabled) // 裁剪是否可旋转图片 true or false
.scaleEnabled(scaleEnabled)// 裁剪是否可放大缩小图片 true or false
.selectionMedia(selectList) // 当前已选中的图片 List
.forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code
}
......@@ -208,6 +211,9 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
boolean showCropFrame = this.cameraOptions.getBoolean("showCropFrame");
boolean showCropGrid = this.cameraOptions.getBoolean("showCropGrid");
boolean compress = this.cameraOptions.getBoolean("compress");
boolean freeStyleCropEnabled = this.cameraOptions.getBoolean("freeStyleCropEnabled");
boolean rotateEnabled = this.cameraOptions.getBoolean("rotateEnabled");
boolean scaleEnabled = this.cameraOptions.getBoolean("scaleEnabled");
int minimumCompressSize = this.cameraOptions.getInt("minimumCompressSize");
int quality = this.cameraOptions.getInt("quality");
......@@ -220,7 +226,7 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
.glideOverride(160, 160)// int glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度
.withAspectRatio(CropW, CropH)// int 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
.hideBottomControls(isCrop)// 是否显示uCrop工具栏,默认不显示 true or false
.freeStyleCropEnabled(true)// 裁剪框是否可拖拽 true or false
.freeStyleCropEnabled(freeStyleCropEnabled)// 裁剪框是否可拖拽 true or false
.circleDimmedLayer(showCropCircle)// 是否圆形裁剪 true or false
.showCropFrame(showCropFrame)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false
.showCropGrid(showCropGrid)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
......@@ -228,8 +234,8 @@ public class RNSyanImagePickerModule extends ReactContextBaseJavaModule {
.cropCompressQuality(quality)// 裁剪压缩质量 默认90 int
.minimumCompressSize(minimumCompressSize)// 小于100kb的图片不压缩
.synOrAsy(true)//同步true或异步false 压缩 默认同步
.rotateEnabled(true) // 裁剪是否可旋转图片 true or false
.scaleEnabled(true)// 裁剪是否可放大缩小图片 true or false
.rotateEnabled(rotateEnabled) // 裁剪是否可旋转图片 true or false
.scaleEnabled(scaleEnabled)// 裁剪是否可放大缩小图片 true or false
.forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code
}
......
......@@ -21,6 +21,9 @@ const defaultOptions = {
circleCropRadius: ~~(width / 4), // 圆形裁剪半径,默认屏幕宽度一半
showCropFrame: true, // 是否显示裁剪区域,默认true
showCropGrid: false, // 是否隐藏裁剪区域网格,默认false
freeStyleCropEnabled: false, // 裁剪框是否可拖拽
rotateEnabled: true, // 裁剪是否可旋转图片
scaleEnabled: true, // 裁剪是否可放大缩小图片
compress: true,
minimumCompressSize: 100, // 小于100kb的图片不压缩
quality: 90, // 压缩质量
......
{
"name": "react-native-syan-image-picker",
"version": "0.3.6",
"version": "0.3.7",
"description": "React-Native 多图片选择 支持裁剪 压缩",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment