How to get a NSDATE from UIImage?

前端 未结 3 989
栀梦
栀梦 2021-01-07 04:08

How do i get a date or metadata from a UIImage in this case:

//UIImagePickerControllerSourceType
picker.sourceType = UIImagePickerControllerSourceTypePhotoLi         


        
相关标签:
3条回答
  • 2021-01-07 04:49

    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+?

    0 讨论(0)
  • 2021-01-07 04:49
    NSDictionary *metadata = [info objectForKey: UIImagePickerControllerMediaMetadata];
    NSLog(@"%@",metadata);
    

    Choose what you need from metadata.

    0 讨论(0)
  • 2021-01-07 04:53

    The info dictionary contains a key called "UIImagePickerControllerMediaMetadata" which is another dictionary. Just NSLog allKeys of that to get the date key.

    0 讨论(0)
提交回复
热议问题