Problema ao definir dados exif para uma imagem
Estou usando a nova estrutura do ImageIO no iOS 4.1. Recuperei com êxito os metadados exif usando o seguinte:
CFDictionaryRef metadataDict = CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary , NULL);
Lendo, parece válido. Salvar uma imagem funciona, mas nunca há dados exif na imagem.
CGImageDestinationRef myImageDest = CGImageDestinationCreateWithURL((CFURLRef) docurl, kUTTypeJPEG, 1, NULL);
// Add the image to the destination using previously saved options.
CGImageDestinationAddImage(myImageDest, iref, NULL);
//add back exif
NSDictionary *props = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithFloat:.1], kCGImageDestinationLossyCompressionQuality,
metadataDict, kCGImagePropertyExifDictionary, //the exif metadata
nil];
//kCGImagePropertyExifAuxDictionary
CGImageDestinationSetProperties(myImageDest, (CFDictionaryRef) props);
// Finalize the image destination.
bool status = CGImageDestinationFinalize(myImageDest);