liuw-flexi

heic 格式的照片,传给后台,web端可能无法显示。所以考虑转成jpg 或者png格式。

注意:光改文件的后缀是不行的,还得转一下NSData格式。

CIImage *ciImage = [CIImage imageWithData:imageData];
CIContext *context = [CIContext context];
NSData *jpgData = [context JPEGRepresentationOfImage:ciImage colorSpace:ciImage.colorSpace options:@{}];
JPEGRepresentationOfImage方法在CIContext类中 ,也可以用PNGRepresentationOfImage方法转成png格式

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2022-01-01
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2021-09-11
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案