-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
decodedImageWithImage solve the problem CGBitmapContextCreate #1401
Comments
@LilyHZ are you using the latest version? the code you have posted is not in the |
@mythodeia I see the same with
|
@a13xb can you please share that image? |
@a13xb i will take a look at it thanks |
@mythodeia Yes, it's not supported, but it happens when SDWebImage creates output context with the wrong pixel format, taking some parameters from input image, hardcoding other parameters, so sometimes they don't match. Moreover, this image used to work on previous versions of SDWebImage, so it's definitely a regression. |
@a13xb i will take a closer look later today. 👍 |
@a13xb if you replace CGImageGetBitsPerComponent(imageRef) with 8 it works fine. but i cannot hardcode this for these kind of images. A better solution would be to check if the bits per component result in an unsupported combination and if it does then roll back to hardcoded 8. |
fixed #1496 |
CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 16 bits/pixel; 1-component color space; kCGImageAlphaPremultipliedFirst; 128 bytes/row.
CGContextDrawImage: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
answer:
(UIImage *)decodedImageWithImage:(UIImage *)image {
@autoreleasepool{
// do not decode animated images
if (image.images) { return image; }
}
The text was updated successfully, but these errors were encountered: