I'm trying to load pictures in iPhone Photos app, then save the selected pictures in to my app's folder, using ALAssetsLibrary, and have two issues: 1. the image file saved to disk is much bigger then original files in Photos app, for example, a picture is 2.8MB, but after saved to my app's folder, it's 6.4MB, following is the code:
CGImageRef cgImage = [localPhoto thumbnail];
NSString *path = @"/documents/test/1.jpeg";//the path is just an example
BOOL succ;
UIImage *image1 = [UIImage imageWithCGImage:cgImage];
NSData *data1 = UIImageJPEGRepresentation(image1, 1.0);
succ = [data1 writeToFile:path atomically:YES];
- the above code(saving 6.4MB image to file) costs about 1.6seconds, is it normal? is there anyway to make it faster?