mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2516 from rtissera/ios43_jpeg_fix
Fix iOS 4.3 JPEG loading (darken picture, alpha issue)
This commit is contained in:
commit
cc3f75c789
|
@ -57,6 +57,13 @@ static bool _initWithImage(CGImageRef cgImage, tImageInfo *pImageinfo)
|
|||
|| (info == kCGImageAlphaLast)
|
||||
|| (info == kCGImageAlphaFirst);
|
||||
|
||||
// If OS version < 5.x, add condition to support jpg
|
||||
float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
|
||||
if(systemVersion < 5.0f)
|
||||
{
|
||||
pImageinfo->hasAlpha = (pImageinfo->hasAlpha || (info == kCGImageAlphaNoneSkipLast));
|
||||
}
|
||||
|
||||
CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage);
|
||||
if (colorSpace)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue