Skip to content

Instantly share code, notes, and snippets.

@tsuyukimakoto
tsuyukimakoto / read_exif_data.swift
Created August 9, 2014 09:57
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)
}