使用UIImageWriteToSavedPhotosAlbum(:::)
方法后,我有一张图片,尺寸为2347kb。使用照片查看大小737kb。为什么?我真的不知道。谁能告诉我?
代码:
NSData * data = UIImageJPEGRepresentation(image,1);
CGFloat length = [data length]/1024.0; // 2347 kb
self.showLabel.text = [NSString stringWithFormat:@"%.0fKB",length];
UIImageWriteToSavedPhotosAlbum(self.scalePhoto, self,@selector(image:didFinishSavingWithError:contextInfo:), NULL);
//result
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
NSData * data = UIImageJPEGRepresentation(image,1);
CGFloat length = [data length]/1024.0; // 2347 kb
NSLog(@"image = %@, error = %@, contextInfo = %@", image, error, contextInfo);
if (error) {
[Tools acquirePhotoAuth:^(BOOL grant) {
if (!grant) {
//setting
}
else{
//error
}
}];
}
else{
//success
}
}
为什么在桌面显示大小为737kb?