Post

Replies

Boosts

Views

Activity

Reply to Can't generate live photo in iOS 15.1
func addAssetID(_ assetIdentifier: String, toImage imageURL: URL, saveTo destinationURL: URL) -> URL? {                  let kFigAppleMakerNote_AssetIdentifier = "17"                  let image = UIImage(contentsOfFile: imageURL.path)         let imageRef = image?.cgImage         let imageMetadata = [kCGImagePropertyMakerAppleDictionary: [kFigAppleMakerNote_AssetIdentifier: assetIdentifier]]         let cfUrl = destinationURL as CFURL         let dest = CGImageDestinationCreateWithURL(cfUrl, kUTTypeJPEG, 1, nil)         CGImageDestinationAddImage(dest!, imageRef!, imageMetadata as CFDictionary)         _ = CGImageDestinationFinalize(dest!)                  return destinationURL     }
Nov ’21