3
AVFoundation을 사용하여 UIView에서 이미지를 캡처하고 주석을 추가했습니다. 이제 캡처 한 이미지의 위치 정보를 가져와야합니다. 현재 코드 스 니펫은 아래와 같습니다. 메타 데이터에 Geolocation이 없습니다. 어쩌면 CLLocation을 사용해야합니까? 최대한 빨리 안내해주세요.AVFoundation의 AVCaptureStillImageOutput을 사용하여 캡처 한 이미지의 위치 정보 가져 오기
[stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
CFDictionaryRef metadataDict = CMCopyDictionaryOfAttachments(NULL, imageSampleBuffer, kCMAttachmentMode_ShouldPropagate);
NSMutableDictionary *metadata = [[NSMutableDictionary alloc] initWithDictionary:(__bridge NSDictionary*)metadataDict];
CFRelease(metadataDict);
NSLog(@"%@",metadata);
CFDictionaryRef exifAttachments = CMGetAttachment(imageSampleBuffer, kCGImagePropertyExifDictionary, NULL);
if (exifAttachments)
{
// Do something with the attachments.
}
else
NSLog(@"no attachments");
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
[captureSession stopRunning];
[imageData writeToFile:path atomically:YES];
}];