how to read heic properties in mac os 10.13?

In my cocoa application i want to read .heic which contains multple images. However i am able read properties for the first image inside .heic below code which i am using. Is it possible to read in High sierra ?


let source = CGImageSourceCreateWithURL(inputURL as CFURL, nil)

if let source = source{

if let imageProperties = CGImageSourceCopyPropertiesAtIndex(source, 0, nil) as? [String: Any]{

print("image properties \(String(describing: imageProperties))")

}

if let image = CGImageSourceCreateImageAtIndex(source, 0, nil) {

print("image\(image)")

}

}

Did you try to loop through all indexes ?


let source = CGImageSourceCreateWithURL(inputURL as CFURL, nil)

if let source = source {

for index in 0..<cgimagesourcegetcount(source {

if let imageProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil) as? [String: Any] {

print("image properties \(String(describing: imageProperties))")

}

if let image = CGImageSourceCreateImageAtIndex(source, index, nil) {

print("image\(image)")

}

}

how to read heic properties in mac os 10.13?
 
 
Q