[英]capture image from iphone camera or get it from library, How to get the image capture time?
I am working on iphone application, sort the images wrt image capture time. 我正在开发iphone应用程序,按图像捕获时间对图像进行排序。
How to get the image capture time? 如何获取图像捕获时间?
Thanks. 谢谢。
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSDictionary *metadata = [[NSDictionary alloc] initWithDictionary:[info objectForKey:UIImagePickerControllerMediaMetadata]];
NSDictionary *exifData = [[NSDictionary alloc] initWithDictionary:[metadata objectForKey:@"{Exif}"]];
NSString *captureDate = [exifData objectForKey:@"DateTimeOriginal"];
NSLog(@"Date: %@", captureDate);
}
Result: Date: 2013:11:07 15:19:45 结果:日期:2013:11:07 15:19:45
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.