Skip to content

Instantly share code, notes, and snippets.

@tsuyukimakoto
Created August 9, 2014 09:57
Show Gist options
  • Save tsuyukimakoto/c7ef8ed096a3e22bda7d to your computer and use it in GitHub Desktop.
Save tsuyukimakoto/c7ef8ed096a3e22bda7d to your computer and use it in GitHub Desktop.
Read exif data from raw file.
import Foundation
import Cocoa
for arg in Process.arguments[1...Process.arguments.count - 1] {
let cgDataRef = CGImageSourceCreateWithURL(NSURL.URLWithString("file://\(arg)"), nil).takeUnretainedValue()
let imageDict:CFDictionaryRef = CGImageSourceCopyPropertiesAtIndex(cgDataRef, 0, nil).takeUnretainedValue()
println(imageDict)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment