Swift

Swiftで写真からExif情報を取得する

More than 3 years have passed since last update.


ImagePickerController.swift

class ImagePicker : ImagePickerControllerDelegate{

// 実装
func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info: NSDictionary!) {
//写真のメターデータよこせ
let metadata = info[UIImagePickerControllerMediaMetadata]!
// Exifの参照を取得
let exif = metadata[kCGImagePropertyExifDictionary]
println(exif)
// 向きをよこせ
let orientation = metadata[kCGImagePropertyOrientation]
println(o)
}
}