"Performing an expensive bottomless operation!" - what is it, and how to fix it?

The debug console for my test Core Filters application shows this message:

CGImageRef 0x7a0e890 has an addition to the string byte. Performing an expensive unpacking operation!

I could not find a hit for this exact message (minus the pointer) in the headers or in a Google search.

My questions are: (1) what does this mean and (2) how can I fix the situation?

Below is an example of how I create filtered UIImage using CIFilter.

- (UIImage*)sepia
{    
    CIImage *beginImage = [CIImage imageWithCGImage:[self CGImage]];
    CIContext *context = [CIContext contextWithOptions:nil];

    CIFilter *filter = [CIFilter filterWithName:@"CISepiaTone" 
                                  keysAndValues: kCIInputImageKey, beginImage, 
                        @"inputIntensity", [NSNumber numberWithFloat:0.8], nil];
    CIImage *outputImage = [filter outputImage];

    CGImageRef cgimg = 
    [context createCGImage:outputImage fromRect:[outputImage extent]];
    UIImage *newImg = [UIImage imageWithCGImage:cgimg];

    self = newImg;

    CGImageRelease(cgimg);
    return self;
}
+5
source share
3 answers

- , , , 2 ^ n- . . , CGImageGetBytesPerRow , .

, - , . Unpadding , , .

+4

, - , , :

, , Thuggish Nuggets. , 8. 8, , 8, .

(, ) , :

UIImage *image = ...;
CGSize targetSize = image.frame.size; //e.g. 51 x 51
double aspectRatio = targetSize.width / targetSize.height;
targetSize.width = targetSize.width + 8 - ((int)targetSize.width % 8);
targetSize.height = targetSize.width / aspectRatio;
+1

, " " . . , . , .

0

All Articles