断言失败 - GPUImagePicture

时间:2017-10-28 20:24:19

标签: ios objective-c xcode

我想知道是否有人能指出我正确的方向。

为什么使用以下代码会导致断言失败:

if (Butten.tag==1) {
        //int errorCount = 0;
        //UIImage *filterImage;
        GPUImageAmatorkaFilter *ColorMatrix=[[GPUImageAmatorkaFilter alloc]init];
        [ColorMatrix prepareForImageCapture];
        UIImage *filterImage=[ColorMatrix imageByFilteringImage:img_MainImage];

        //while (! (filterImage = [ColorMatrix imageByFilteringImage:img_MainImage]) ) {
         //   ++errorCount;
        //}

        //if (errorCount > 0) {
            //NSLog(@"GPUImageiOSBlurFilter imageByFilteringImage button clicked:");
        //}
        vw_MainImage.image=filterImage;
        image_Edited =filterImage;
        lbl_MenuType.text=[arr_Effectname objectAtIndex:0];
        filterImage=nil;
        free((__bridge void *)(filterImage));
    }

错误是:

断言失败 - [GPUImagePicture initWithCGImage:smoothScaleOutput:removePultiultiplication:],/ Users / Darrenedwards /Desktop / app / Source / iOS / GPUImagePicture.m:94

第94行是:

 NSAssert( widthOfImage > 0 && heightOfImage > 0, @"Passed image must not be empty - it should be at least 1px tall and wide");

0 个答案:

没有答案