A simple image file metadata extraction utility in Swift.
This Swift Package was designed to be a simple utility tool to extract metadata from image files levraging Apple's 'Image I/O' Framework, which can "read and write most image file formats, and access an image’s metadata".
SwiftImageMetadata is available as a Swift Package. To install it, simply add the following line to your 'Package.swift' file:
.package(url: "https://github.com/bdh777psu/SwiftImageMetadata", branch: "main"),
...or drag the SwiftImageMetadata.swift file into your project.
import SwiftImageMetadata
let pathToFile = URL(filePath: "/path/file.heic")
let simUtil = SwiftImageMetadata()
let metadata = simUtil.readImageMetadata(fromURL: pathToFile, forMetadata: .gps)
print(metadata)
.all //returns all available metadata
.exif
.gps
.makeApple
.tiff
Diogo Lessa
SwiftImageMetadata is available under the MIT license.