mirror of
https://github.com/SDWebImage/SDWebImage.git
synced 2026-04-07 19:27:40 +00:00
Merge pull request #203 from Stigec/master
Fixed Alpha detection when decoding images.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user