Skip to content
Browse files

Remove alpha channel (may break some PNG/GIF with alpha, pull request…

… welcome)
  • Loading branch information...
1 parent 324aae6 commit c32f9c03f816dac58a8cac25d6189310272ca9c1 @rs committed Sep 12, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 SDWebImage/SDWebImageDecoder.m
View
5 SDWebImage/SDWebImageDecoder.m
@@ -107,7 +107,10 @@ + (UIImage *)decodedImageWithImage:(UIImage *)image
// System only supports RGB, set explicitly
colorSpace,
// Makes system don't need to do extra conversion when displayed.
- kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little);
+ // NOTE: here we remove the alpha channel for performance. Most of the time, images loaded
+ // from the network are jpeg with no alpha channel. As a TODO, finding a way to detect
+ // if alpha channel is necessary would be nice.
+ kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Little);
CGColorSpaceRelease(colorSpace);
if (!context) return nil;

0 comments on commit c32f9c0

Please sign in to comment.
Something went wrong with that request. Please try again.