I wish to extract the image using ALAssetsLibrary and ALAsset directly in the form of a NSData object.
Using a NSURL I take out the image in the following manner.
NSURL *referenceURL =newURL;
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library assetForURL:referenceURL resultBlock:^(ALAsset *asset)
{
UIImage *copyOfOriginalImage = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullResolutionImage]];
}
Now here we take the image as a UIImage, but I need to take the image directly as NSData.
I wish to do this because (I have read that) once you take the image in UIImage, then we lose all the EXIF details of the Image.
That's the reason I want to extract the image directly as NSData, instead of doing this
NSData *webUploadData=UIImageJPEGRepresentation(copyOfOriginalImage, 0.5);
This step makes me lose all the EXIF details.
Please Help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…