【发布时间】:2014-07-06 10:05:44
【问题描述】:
您好,我正在尝试使用新的 GPUImage 设置编辑单个图像,但遇到以下错误。
2014-07-06 11:52:46.966 App[4314:9d07] *** Assertion failure in -[GPUImageFramebuffer generateFramebuffer], /Users/Desktop/Apps/App/App/framework/Source/GPUImageFramebuffer.m:156
2014-07-06 11:52:46.968 App[4314:9d07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error at CVPixelBufferCreate -6661'
*** First throw call stack:
(0x2e52dfd3 0x38da6ccf 0x2e52dead 0x2eedad5b 0xb9ca7 0x6c481 0xb990f 0xb93cf 0xbbef1 0x6c481 0xbbc67 0x98229 0x61b39 0x98d9d 0x7065f 0x3928e833 0x39294f11 0x39294c97 0x39295a45 0x39295d29 0x393d0bd3 0x393d0a98)
libc++abi.dylib: terminating with uncaught exception of type NSException
GPUImagePicture *lookupImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"BigApple1.png"]];
GPUImageLookupFilter * filterLookup = [[GPUImageLookupFilter alloc] init];
[stillImageSource addTarget:filterLookup];
[lookupImageSource addTarget:filterLookup];
[stillImageSource useNextFrameForImageCapture];
[lookupImageSource useNextFrameForImageCapture];
[stillImageSource processImage];
[lookupImageSource processImage];
finishedImage = [filterLookup imageFromCurrentFramebuffer];
【问题讨论】:
-
我一直在与同样的事情作斗争。确保您的 UIImage 对象具有非 CGSizeZero 大小。这通常是罪魁祸首。您能否发布完整的错误,以便其他人和我可以更好地帮助您?
-
嗨,是的,我将代码切换到 GPUImage 自述文件中的示例,它运行正常。一旦我把它放回上面,问题就回来了。源图像和查找源都存在。
-
能不能直接在filter obj上试试“imageByFilteringImage:”方法,看看会不会抛出同样的错误?
标签: ios objective-c ios7 gpuimage