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
e3a95ad9
Commit
e3a95ad9
authored
Jun 03, 2017
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化超高图片的显示,限制获取大小防止内存暴增
parent
0a4ee696
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+5
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
e3a95ad9
...
...
@@ -418,10 +418,14 @@ static CGFloat TZScreenScale;
PHAsset
*
phAsset
=
(
PHAsset
*
)
asset
;
CGFloat
aspectRatio
=
phAsset
.
pixelWidth
/
(
CGFloat
)
phAsset
.
pixelHeight
;
CGFloat
pixelWidth
=
photoWidth
*
TZScreenScale
*
1
.
5
;
//
优化超宽图片的显示
//
超宽图片
if
(
aspectRatio
>
1
)
{
pixelWidth
=
pixelWidth
*
aspectRatio
;
}
// 超高图片
if
(
aspectRatio
<
0
.
2
)
{
pixelWidth
=
pixelWidth
*
0
.
5
;
}
CGFloat
pixelHeight
=
pixelWidth
/
aspectRatio
;
imageSize
=
CGSizeMake
(
pixelWidth
,
pixelHeight
);
}
...
...
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