如何从 UIImage 获取 NSDATE?
在这种情况下,如何从 UIImage 获取日期或元数据:
//UIImagePickerControllerSourceType
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//delegate return
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
// po info in console -> there is no metadata of the image where i can find the date
// Has anyone an idea how to get it?
}
How do i get a date or metadata from a UIImage in this case:
//UIImagePickerControllerSourceType
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//delegate return
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
// po info in console -> there is no metadata of the image where i can find the date
// Has anyone an idea how to get it?
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您指的是图像中的 EXIF 元数据(其中包括日期信息),您可以查看此问题以获取有关如何访问它的信息:
如何在 iOS 4.0+ 中访问从相机拍摄的照片中的照片 EXIF?
If you are referring to EXIF metadata in the image (which includes date information), you can see this question for information on how to access it:
How to access photo EXIF in pictures taken from camera in iOS 4.0+?
信息字典包含一个名为“UIImagePickerControllerMediaMetadata”的键,它是另一个字典。只需 NSLog allKeys 即可获取日期密钥。
The info dictionary contains a key called "UIImagePickerControllerMediaMetadata" which is another dictionary. Just NSLog allKeys of that to get the date key.
从元数据中选择您需要的内容。
Choose what you need from metadata.