- (UIImage *)imaYasuo:(UIImage *)image {
// 原始數(shù)據(jù)
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之內(nèi)