heic格式转换成jpg并保留元数据
作者:
emore | 来源:发表于
2019-07-25 10:51 被阅读0次 if format == .heic { // .heic格式转成jpg
DispatchQueue.global().async {
guard let ciImage = CIImage(data: self) else {
let new = image.jpegData(compressionQuality: 1) ?? self
handler(data: new)
return
}
let ciContext = CIContext.init()
var imageData: Data?
if #available(iOS 10.0, *) {
imageData = ciContext.jpegRepresentation(of: ciImage, colorSpace: ciImage.colorSpace!, options: [:])
}
if imageData == nil {
imageData = image.jpegData(compressionQuality: 1.0) ?? self
}
handler(data: imageData!)
}
}
本文标题:heic格式转换成jpg并保留元数据
本文链接:https://www.haomeiwen.com/subject/kjmcrctx.html
网友评论