给定 Data 及其 UTI,将其转换为 JPEG 的正确方法是什么?
PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: { (imageData: Data?, dataUTI: String?, _, _) in
guard let imageData = imageData, let dataUTI = dataUTI else { return }
if !UTTypeConformsTo(dataUTI as CFString, kUTTypeJPEG) {
//TODO: Convert to JPEG
}
})