Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-syan-image-picker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenSource
react-native-syan-image-picker
Commits
62f445a4
Commit
62f445a4
authored
Oct 16, 2018
by
Syan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v0.2.0
parent
6dd4a738
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
index.js
index.js
+1
-1
RNSyanImagePicker.m
ios/RNSyanImagePicker.m
+2
-2
package.json
package.json
+1
-1
No files found.
index.js
View file @
62f445a4
...
@@ -18,7 +18,7 @@ const defaultOptions = {
...
@@ -18,7 +18,7 @@ const defaultOptions = {
CropH
:
~~
(
width
*
0.6
),
// 裁剪高度,默认屏幕宽度60%
CropH
:
~~
(
width
*
0.6
),
// 裁剪高度,默认屏幕宽度60%
isGif
:
false
,
// 是否允许选择GIF,默认false,暂无回调GIF数据
isGif
:
false
,
// 是否允许选择GIF,默认false,暂无回调GIF数据
showCropCircle
:
false
,
// 是否显示圆形裁剪区域,默认false
showCropCircle
:
false
,
// 是否显示圆形裁剪区域,默认false
circleCropRadius
:
width
/
2
,
// 圆形裁剪半径,默认屏幕宽度一半
circleCropRadius
:
~~
(
width
/
4
)
,
// 圆形裁剪半径,默认屏幕宽度一半
showCropFrame
:
true
,
// 是否显示裁剪区域,默认true
showCropFrame
:
true
,
// 是否显示裁剪区域,默认true
showCropGrid
:
false
,
// 是否隐藏裁剪区域网格,默认false
showCropGrid
:
false
,
// 是否隐藏裁剪区域网格,默认false
quality
:
90
,
// 压缩质量
quality
:
90
,
// 压缩质量
...
...
ios/RNSyanImagePicker.m
View file @
62f445a4
...
@@ -127,7 +127,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
...
@@ -127,7 +127,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
if
(
isCrop
){
if
(
isCrop
){
if
(
showCropCircle
)
{
if
(
showCropCircle
)
{
imagePickerVc
.
needCircleCrop
=
showCropCircle
;
//圆形裁剪
imagePickerVc
.
needCircleCrop
=
showCropCircle
;
//圆形裁剪
imagePickerVc
.
circleCropRadius
=
circleCropRadius
/
2
;
//圆形半径
imagePickerVc
.
circleCropRadius
=
circleCropRadius
;
//圆形半径
}
else
{
}
else
{
CGFloat
x
=
([[
UIScreen
mainScreen
]
bounds
].
size
.
width
-
CropW
)
/
2
;
CGFloat
x
=
([[
UIScreen
mainScreen
]
bounds
].
size
.
width
-
CropW
)
/
2
;
CGFloat
y
=
([[
UIScreen
mainScreen
]
bounds
].
size
.
height
-
CropH
)
/
2
;
CGFloat
y
=
([[
UIScreen
mainScreen
]
bounds
].
size
.
height
-
CropH
)
/
2
;
...
@@ -243,7 +243,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
...
@@ -243,7 +243,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
TZImagePickerController
*
imagePicker
=
[[
TZImagePickerController
alloc
]
initCropTypeWithAsset
:
assetModel
.
asset
photo
:
image
completion
:^
(
UIImage
*
cropImage
,
id
asset
)
{
TZImagePickerController
*
imagePicker
=
[[
TZImagePickerController
alloc
]
initCropTypeWithAsset
:
assetModel
.
asset
photo
:
image
completion
:^
(
UIImage
*
cropImage
,
id
asset
)
{
[
self
invokeSuccessWithResult
:@[[
self
handleImageData
:
cropImage
quality
:
quality
]]];
[
self
invokeSuccessWithResult
:@[[
self
handleImageData
:
cropImage
quality
:
quality
]]];
}];
}];
imagePicker
.
allow
Crop
=
isCrop
;
// 裁剪
imagePicker
.
allow
PickingImage
=
YES
;
if
(
showCropCircle
)
{
if
(
showCropCircle
)
{
imagePicker
.
needCircleCrop
=
showCropCircle
;
//圆形裁剪
imagePicker
.
needCircleCrop
=
showCropCircle
;
//圆形裁剪
imagePicker
.
circleCropRadius
=
circleCropRadius
;
//圆形半径
imagePicker
.
circleCropRadius
=
circleCropRadius
;
//圆形半径
...
...
package.json
View file @
62f445a4
{
{
"name"
:
"react-native-syan-image-picker"
,
"name"
:
"react-native-syan-image-picker"
,
"version"
:
"0.
1.9
"
,
"version"
:
"0.
2.0
"
,
"description"
:
"React-Native 多图片选择 支持裁剪 压缩"
,
"description"
:
"React-Native 多图片选择 支持裁剪 压缩"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment