JPG image becomes dark

Hello everyone,

I use JPG image as background image in my game to reduce size.
It’s working fine in >iOS 5. But in iOS 4.3.3 it become dark as shown in the attached image.
It will be great if anyone can explain exactly why this problem can be occurred and how it can be resolved.

Thanks


iOS 4.3.3.PNG (189.7 KB)


_iOS 5.PNG (862.4 KB)

you can find cocos2dx/platform/ios/CCImage.mm , and replace

pImageinfo~~>hasAlpha =
||
||
|| ;
to:
pImageinfo~~>hasAlpha = ((info kCGImageAlphaNoneSkipLast) || (info kCGImageAlphaPremultipliedLast) || (info kCGImageAlphaPremultipliedFirst) || (info kCGImageAlphaLast) || (info == kCGImageAlphaFirst) ? YES : NO);

It works. Thanks.
I am also informed that it takes much longer times to load JPG than PNG. So I think anyone should rethink before using it instead of PNG.

We ran into this bug and submitted (suggested) fix in a pull request : https://github.com/cocos2d/cocos2d-x/pull/1942
Please consider merging it to master, 4.3 support is still something important to keep when possible IMHO

It is merged.
Thank you.