美文网首页
<Error>: ImageIO: CGImageR

<Error>: ImageIO: CGImageR

作者: TEASON | 来源:发表于2015-09-09 18:43 被阅读255次

BUG出现描述
: ImageIO: CGImageReadCreateDataWithMappedFile 'open' failed '路径'
error = 2 (No such file or directory)

[BUG原因]
原因:保存时,图片已被删除
解决方案:从路径读取图片后,先转换成NSData,再生成一张新的image.

UIImage*tempImage = [[UIImagealloc]initWithContentsOfFile:path];
NSData*tempData = UIImageJPEGRepresentation(tempImage,1.0);
UIImage*newImage = [UIImageimageWithData:coverData];

相关文章

网友评论

      本文标题:<Error>: ImageIO: CGImageR

      本文链接:https://www.haomeiwen.com/subject/zklpcttx.html