Commit e3a95ad9 authored by yuzheng.tz's avatar yuzheng.tz

优化超高图片的显示,限制获取大小防止内存暴增

parent 0a4ee696
......@@ -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);
}
......
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