0

Hi, I seem to get an Assertion failure with the following code:

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));
    }

Error is:

Assertion failure in -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:removePremultiplication:], /Users/darrenedwards/Desktop/app/Source/iOS/GPUImagePicture.m:94

Line 94 is:

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

I am new to iOS development and was wondering where I would start to resolve this? How can i make sure the image is not empty or at least a size above 0px?

Edited by darren2005

1
Contributor
0
Replies
8
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.