Usar ALAssetsLibrary e ALAsset extraem Image como NSData

Desejo extrair a imagem usando ALAssetsLibrary e ALAsset diretamente na forma de um objeto NSDat

Usando um NSURL, retiro a imagem da seguinte maneir

NSURL *referenceURL =newURL;
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library assetForURL:referenceURL resultBlock:^(ALAsset *asset)
{
     UIImage  *copyOfOriginalImage = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullResolutionImage]];
}

Agora, aqui tomamos a imagem como UIImage, mas preciso levá-la diretamente como NSDat

Eu desejo fazer isso porque (li isso) depois que você obtém a imagem no UIImage, perdemos todos os detalhes EXIF da image

Essa é a razão pela qual desejo extrair a imagem diretamente como NSData, em vez de fazer isso

NSData *webUploadData=UIImageJPEGRepresentation(copyOfOriginalImage, 0.5);

Esta etapa me faz perder todos os detalhes EXIF.

Por favor ajude

questionAnswers(3)

yourAnswerToTheQuestion