Difference between revisions of "Get EXIF Data from Image in Swift"

From PeformIQ Wiki
Jump to navigation Jump to search
(Created page with " This seems to work: <pre> import ImageIO ... func getExif(_ uRLToTheImageFile: URL) { if let imageSource = CGImageSourceCreateWithURL(fileURL as CFURL, nil) { l...")
 
(No difference)

Latest revision as of 21:53, 16 October 2021

This seems to work:


import ImageIO
...

func getExif(_ uRLToTheImageFile: URL)
{
    if let imageSource = CGImageSourceCreateWithURL(fileURL as CFURL, nil) {
        let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil)
        if let dict = imageProperties as? [String: Any] {
            print(dict)
        }
    }
}

From - http://stackoverflow.com/questions/40175160/exif-data-read-and-write