美文网首页
使用UIGPImage崩溃报错

使用UIGPImage崩溃报错

作者: coding_chen | 来源:发表于2016-08-12 10:18 被阅读0次
  • 使用GPUImage时"reason: 'Passed image must not be empty - it should be at least 1px tall and wide" 出现这个崩溃原因.

  • 个人经验出现这个问题的原因就是使用了自定义的滤镜, 而在滤镜的.m文件中一般会有这个下面这个方法

 
    UIImage *image = [UIImage imageNamed:@"1977map"];
    imageSource1 = [[GPUImagePicture alloc] initWithImage:image];
    [imageSource1 addTarget:filter atTextureLocation:1];
    [imageSource1 processImage];
  • 请注意里面的UIImage赋值的方法, 这个是要传入一张图片的, 之所以会出现上面的崩溃原因, 应该去查找一下, 看看文件中是否有这个image对象.

相关文章

网友评论

      本文标题:使用UIGPImage崩溃报错

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