Skip to content

Commit 84501d3

Browse files
committed
fix potential image encode error in iOS6.
1 parent 66f20c4 commit 84501d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

YYImage/YYImageCoder.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ Try convert with vImageConvert_AnyToAny() (avaliable since iOS 7.0).
822822
} else {
823823
contextBitmapInfo |= alphaFirst ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaPremultipliedLast;
824824
}
825-
CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 32, YYCGColorSpaceGetDeviceRGB(), contextBitmapInfo);
825+
CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, YYCGColorSpaceGetDeviceRGB(), contextBitmapInfo);
826826
if (!context) goto fail;
827827

828828
CGContextDrawImage(context, CGRectMake(0, 0, width, height), srcImage); // decode and convert

0 commit comments

Comments
 (0)