Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release版本运行报错 #132

Open
Jvaeyhcd opened this issue May 19, 2015 · 0 comments
Open

release版本运行报错 #132

Jvaeyhcd opened this issue May 19, 2015 · 0 comments

Comments

@Jvaeyhcd
Copy link

老郭,debug模式下正常,但是在release模式下报错
unsupported parameter combination: 8 integer bits/component; 16 bits/pixel; 1-component color space; kCGImageAlphaPremultipliedLast; 96 bytes/row.
报错代码:在UIImage+BeeBeeExtension.m中:

  • (UIImage *)grayscale
    {
    CGSize size = self.size;
    CGRect rect = CGRectMake(0.0f, 0.0f, self.size.width, self.size.height);

    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
    CGContextRef context = CGBitmapContextCreate(nil,
    size.width,
    size.height,
    8,
    0,
    colorSpace,
    CGImageGetBitmapInfo(self.CGImage));

    BeeLog(@"size(%f,%f)",size.width,size.height);
    CGColorSpaceRelease(colorSpace);

    CGContextDrawImage(context, rect, [self CGImage]);
    CGImageRef grayscale = CGBitmapContextCreateImage(context);
    CGContextRelease(context);

    UIImage * image = [UIImage imageWithCGImage:grayscale];
    CFRelease(grayscale);

    return image;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant