Fix alpha handling in image decoder (fix #204)

This commit is contained in:
Olivier Poitrey 2012-11-04 00:51:35 +01:00
parent c609027314
commit 048bdbb751
1 changed files with 2 additions and 2 deletions

View File

@ -104,8 +104,8 @@ static SDWebImageDecoder *sharedInstance;
alphaInfo != kCGImageAlphaNoneSkipFirst &&
alphaInfo != kCGImageAlphaNoneSkipLast);
int bytesPerPixel = imageHasAlphaInfo ? 4 : 3;
CGBitmapInfo bitmapInfo = imageHasAlphaInfo ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNone;
int bytesPerPixel = alphaInfo != kCGImageAlphaNone ? 4 : 3;
CGBitmapInfo bitmapInfo = imageHasAlphaInfo ? kCGImageAlphaPremultipliedLast : alphaInfo;
CGContextRef context = CGBitmapContextCreate(NULL,
CGImageGetWidth(imageRef),