Skip to content

pulselive/ExifTool

 
 

Repository files navigation

ExifTool

MIT License

Simple swiftWrapper to ExifTool (https://exiftool.org)

Requirements

  • iOS 14.0+ / macOS 11+ / tvOS 14.0+
  • Xcode 12+
  • Swift 5.3+

Installation with Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding SunburstDiagram as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/hlemai/ExifTool.git")
]

Usage

Get all metadata in a [String:String] dictionnary.

ExifTool.setExifTool("/path/to/exiftool")
let testFilePath = "DSC04247.jpg"
let url = URL(fileURLWithPath: testFilePath)
let exifData = ExifTool.read(fromurl: url)
// optionnally it is possibile to filter to specific tags by tagname : ExifTool.read(from:url,tags:["ISO"])

for meta in exifData {
    print("\(meta.key)->\(meta.value)")
}

// to get in a dictionnary with local key
for meta in exifData.getMetadata(lang: "fr") {
    print("\(meta.key)->\(meta.value)")
}

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%