Fixed Alpha chanel detection when decoding images.
This commit is contained in:
parent
1a360b6faf
commit
c609027314
|
@ -100,7 +100,9 @@ static SDWebImageDecoder *sharedInstance;
|
|||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef);
|
||||
|
||||
BOOL imageHasAlphaInfo = (alphaInfo != kCGImageAlphaNone);
|
||||
BOOL imageHasAlphaInfo = (alphaInfo != kCGImageAlphaNone &&
|
||||
alphaInfo != kCGImageAlphaNoneSkipFirst &&
|
||||
alphaInfo != kCGImageAlphaNoneSkipLast);
|
||||
|
||||
int bytesPerPixel = imageHasAlphaInfo ? 4 : 3;
|
||||
CGBitmapInfo bitmapInfo = imageHasAlphaInfo ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNone;
|
||||
|
|
Loading…
Reference in New Issue