- (UIImage *)imaYasuo:(UIImage *)image {
// 原始数据
NSData *imgData = UIImageJPEGRepresentation(image, 1.0);
// 原始图片
UIImage *result = [UIImage imageWithData:imgData];
//1024为1KB
while (imgData.length > 200000) {
imgData = UIImageJPEGRepresentation(result, 0.5);
result = [UIImage imageWithData:imgData];
}
return result;
}
图片压缩到 200K之内
网友评论