Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
865d46fa
Commit
865d46fa
authored
Jun 21, 2018
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增notScaleImage属性,设置为YES时内部不去缩放图片
parent
557bb3d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+3
-1
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+5
-0
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+6
-0
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+3
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
865d46fa
...
@@ -553,7 +553,9 @@ static dispatch_once_t onceToken;
...
@@ -553,7 +553,9 @@ static dispatch_once_t onceToken;
options
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
options
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
asset
options
:
options
resultHandler
:^
(
NSData
*
imageData
,
NSString
*
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
info
)
{
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
asset
options
:
options
resultHandler
:^
(
NSData
*
imageData
,
NSString
*
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
info
)
{
UIImage
*
resultImage
=
[
UIImage
imageWithData
:
imageData
scale
:
0
.
1
];
UIImage
*
resultImage
=
[
UIImage
imageWithData
:
imageData
scale
:
0
.
1
];
resultImage
=
[
self
scaleImage
:
resultImage
toSize
:
imageSize
];
if
(
!
[
TZImagePickerConfig
sharedInstance
].
notScaleImage
)
{
resultImage
=
[
self
scaleImage
:
resultImage
toSize
:
imageSize
];
}
if
(
!
resultImage
)
{
if
(
!
resultImage
)
{
resultImage
=
image
;
resultImage
=
image
;
}
}
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
865d46fa
...
@@ -132,6 +132,10 @@
...
@@ -132,6 +132,10 @@
/// Default is white color with 0.8 alpha;
/// Default is white color with 0.8 alpha;
@property
(
strong
,
nonatomic
)
UIColor
*
cannotSelectLayerColor
;
@property
(
strong
,
nonatomic
)
UIColor
*
cannotSelectLayerColor
;
/// Default is No, if set YES, the result photo will not be scaled to photoWidth pixel width. The photoWidth default is 828px
/// 默认是NO,如果设置为YES,内部不会缩放图片到photoWidth像素宽
@property
(
assign
,
nonatomic
)
BOOL
notScaleImage
;
/// The photos user have selected
/// The photos user have selected
/// 用户选中过的图片数组
/// 用户选中过的图片数组
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectedAssets
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectedAssets
;
...
@@ -330,4 +334,5 @@
...
@@ -330,4 +334,5 @@
@property
(
assign
,
nonatomic
)
NSInteger
gifPreviewMaxImagesCount
;
@property
(
assign
,
nonatomic
)
NSInteger
gifPreviewMaxImagesCount
;
@property
(
assign
,
nonatomic
)
BOOL
showSelectedIndex
;
@property
(
assign
,
nonatomic
)
BOOL
showSelectedIndex
;
@property
(
assign
,
nonatomic
)
BOOL
showPhotoCannotSelectLayer
;
@property
(
assign
,
nonatomic
)
BOOL
showPhotoCannotSelectLayer
;
@property
(
assign
,
nonatomic
)
BOOL
notScaleImage
;
@end
@end
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
865d46fa
...
@@ -271,6 +271,7 @@
...
@@ -271,6 +271,7 @@
self
.
barItemTextFont
=
[
UIFont
systemFontOfSize
:
15
];
self
.
barItemTextFont
=
[
UIFont
systemFontOfSize
:
15
];
self
.
barItemTextColor
=
[
UIColor
whiteColor
];
self
.
barItemTextColor
=
[
UIColor
whiteColor
];
self
.
allowPreview
=
YES
;
self
.
allowPreview
=
YES
;
self
.
notScaleImage
=
NO
;
self
.
statusBarStyle
=
UIStatusBarStyleLightContent
;
self
.
statusBarStyle
=
UIStatusBarStyleLightContent
;
self
.
cannotSelectLayerColor
=
[[
UIColor
whiteColor
]
colorWithAlphaComponent
:
0
.
8
];
self
.
cannotSelectLayerColor
=
[[
UIColor
whiteColor
]
colorWithAlphaComponent
:
0
.
8
];
self
.
allowCameraLocation
=
YES
;
self
.
allowCameraLocation
=
YES
;
...
@@ -354,6 +355,11 @@
...
@@ -354,6 +355,11 @@
[
TZImagePickerConfig
sharedInstance
].
showPhotoCannotSelectLayer
=
showPhotoCannotSelectLayer
;
[
TZImagePickerConfig
sharedInstance
].
showPhotoCannotSelectLayer
=
showPhotoCannotSelectLayer
;
}
}
-
(
void
)
setNotScaleImage
:(
BOOL
)
notScaleImage
{
_notScaleImage
=
notScaleImage
;
[
TZImagePickerConfig
sharedInstance
].
notScaleImage
=
notScaleImage
;
}
-
(
void
)
observeAuthrizationStatusChange
{
-
(
void
)
observeAuthrizationStatusChange
{
[
_timer
invalidate
];
[
_timer
invalidate
];
_timer
=
nil
;
_timer
=
nil
;
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
865d46fa
...
@@ -386,7 +386,9 @@ static CGFloat itemMargin = 5;
...
@@ -386,7 +386,9 @@ static CGFloat itemMargin = 5;
[[
TZImageManager
manager
]
getPhotoWithAsset
:
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
[[
TZImageManager
manager
]
getPhotoWithAsset
:
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
if
(
isDegraded
)
return
;
if
(
isDegraded
)
return
;
if
(
photo
)
{
if
(
photo
)
{
photo
=
[[
TZImageManager
manager
]
scaleImage
:
photo
toSize
:
CGSizeMake
(
tzImagePickerVc
.
photoWidth
,
(
int
)(
tzImagePickerVc
.
photoWidth
*
photo
.
size
.
height
/
photo
.
size
.
width
))];
if
(
!
[
TZImagePickerConfig
sharedInstance
].
notScaleImage
)
{
photo
=
[[
TZImageManager
manager
]
scaleImage
:
photo
toSize
:
CGSizeMake
(
tzImagePickerVc
.
photoWidth
,
(
int
)(
tzImagePickerVc
.
photoWidth
*
photo
.
size
.
height
/
photo
.
size
.
width
))];
}
[
photos
replaceObjectAtIndex
:
i
withObject
:
photo
];
[
photos
replaceObjectAtIndex
:
i
withObject
:
photo
];
}
}
if
(
info
)
[
infoArr
replaceObjectAtIndex
:
i
withObject
:
info
];
if
(
info
)
[
infoArr
replaceObjectAtIndex
:
i
withObject
:
info
];
...
...
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