Merge pull request #2516 from rtissera/ios43_jpeg_fix

Fix iOS 4.3 JPEG loading (darken picture, alpha issue)
This commit is contained in:
minggo 2013-05-05 19:18:50 -07:00
commit cc3f75c789
1 changed files with 7 additions and 0 deletions

View File

@ -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)
{