Posts

Post not yet marked as solved
3 Replies
0 Views
I was having the same issue as the original poster. I realized that in my code, as well as in their code, I don't actually need to merge the metadata, as I've actually created an updated version using the mutable copy of the original metadata. Once I removed the following line: let options = [       kCGImageDestinationMetadata as String : mutableMetadata,       // kCGImageDestinationMergeMetadata as String : true // <-- remove this line       ] as [String : Any] it works as expected. The full metadata in mutableMetadata is written properly. I've only tested on jpg and heic files. I do agree that kCGImageDestinationMergeMetadata = true should work as expected, but this work-around is a decent fix. The full code for my working example is here: https://gist.github.com/rob-secondstage/99d30f4e9804c5f250dcb063f779fd87