imageWithData メソッドを使用して UIimage を作成します。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *chosenImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
NSData *data1 = UIImageJPEGRepresentation(chosenImage, 1);
NSData *data2 = UIImageJPEGRepresentation(chosenImage, 0.5);
NSLog(@"data1 = %lu;;;;;;;data2 = %lu",[data1 length],[data2 length]);
UIImage *nimg = [UIImage imageWithData:data2];
NSData *data30 = UIImageJPEGRepresentation(nimg, 1);
NSData *data31 = UIImageJPEGRepresentation(nimg, 0.8);
NSLog(@"data30 = %lu;;;;;;data31 = %lu;;;;;;",[data30 length],[data31 length]);
}
私はこの出力を得る:
data1 = 1751828;;;;;;;data2 = 254737
data30 = 1368455;;;;;;data31 = 387174;;;;;;
data30 が data2 よりもはるかに大きいのはなぜですか?