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
a667c6ed
Commit
a667c6ed
authored
Jun 03, 2017
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化TZImageManager的一些细节
parent
77daaa0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
TZImagePickerController/TZImagePickerController/TZImageManager.h
...PickerController/TZImagePickerController/TZImageManager.h
+1
-1
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+2
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.h
View file @
a667c6ed
...
...
@@ -59,7 +59,7 @@
-
(
int32_t
)
getPhotoWithAsset
:(
id
)
asset
photoWidth
:(
CGFloat
)
photoWidth
completion
:(
void
(
^
)(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
))
completion
progressHandler
:(
void
(
^
)(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
))
progressHandler
networkAccessAllowed
:(
BOOL
)
networkAccessAllowed
;
/// Get full Image 获取原图
/// 该方法
会先返回缩略图,再返回原图
,如果info[PHImageResultIsDegradedKey] 为 YES,则表明当前返回的是缩略图,否则是原图。
/// 该方法
一般会先返回缩略图,再返回原图(详见方法内部使用的系统API的说明)
,如果info[PHImageResultIsDegradedKey] 为 YES,则表明当前返回的是缩略图,否则是原图。
-
(
void
)
getOriginalPhotoWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
UIImage
*
photo
,
NSDictionary
*
info
))
completion
;
-
(
void
)
getOriginalPhotoWithAsset
:(
id
)
asset
newCompletion
:(
void
(
^
)(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
))
completion
;
-
(
void
)
getOriginalPhotoDataWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
NSData
*
data
,
NSDictionary
*
info
,
BOOL
isDegraded
))
completion
;
...
...
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
a667c6ed
...
...
@@ -534,8 +534,9 @@ static CGFloat TZScreenScale;
-
(
void
)
getOriginalPhotoDataWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
NSData
*
data
,
NSDictionary
*
info
,
BOOL
isDegraded
))
completion
{
if
([
asset
isKindOfClass
:[
PHAsset
class
]])
{
PHImageRequestOptions
*
option
=
[[
PHImageRequestOptions
alloc
]
init
];
PHImageRequestOptions
*
option
=
[[
PHImageRequestOptions
alloc
]
init
];
option
.
networkAccessAllowed
=
YES
;
option
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
asset
options
:
option
resultHandler
:^
(
NSData
*
_Nullable
imageData
,
NSString
*
_Nullable
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
_Nullable
info
)
{
BOOL
downloadFinined
=
(
!
[[
info
objectForKey
:
PHImageCancelledKey
]
boolValue
]
&&
!
[
info
objectForKey
:
PHImageErrorKey
]);
if
(
downloadFinined
&&
imageData
)
{
...
...
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