如何从 UIImage 获取 NSDATE?

发布于 2024-10-22 02:01:02 字数 428 浏览 2 评论 0原文

在这种情况下,如何从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

悸初 2024-10-29 02:01:02

如果您指的是图像中的 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+?

欲拥i 2024-10-29 02:01:02

信息字典包含一个名为“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.

不语却知心 2024-10-29 02:01:02
NSDictionary *metadata = [info objectForKey: UIImagePickerControllerMediaMetadata];
NSLog(@"%@",metadata);

从元数据中选择您需要的内容。

NSDictionary *metadata = [info objectForKey: UIImagePickerControllerMediaMetadata];
NSLog(@"%@",metadata);

Choose what you need from metadata.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文