Adjust indention, seems come from buggy Xcode

This commit is contained in:
zhongwuzw 2019-01-19 20:46:05 +08:00
parent fac703140c
commit 4c006ad573
1 changed files with 29 additions and 29 deletions

View File

@ -27,26 +27,26 @@
// Create and return the correct colorspace by checking the ICC Profile // Create and return the correct colorspace by checking the ICC Profile
static CGColorSpaceRef SDColorSpaceCreateWithDemuxer(WebPDemuxer *demuxer) { static CGColorSpaceRef SDColorSpaceCreateWithDemuxer(WebPDemuxer *demuxer) {
// WebP contains ICC Profile should use the desired colorspace, instead of default device colorspace // WebP contains ICC Profile should use the desired colorspace, instead of default device colorspace
// See: https://developers.google.com/speed/webp/docs/riff_container#color_profile // See: https://developers.google.com/speed/webp/docs/riff_container#color_profile
WebPChunkIterator chunk_iter; WebPChunkIterator chunk_iter;
CGColorSpaceRef colorSpaceRef = NULL; CGColorSpaceRef colorSpaceRef = NULL;
int result = WebPDemuxGetChunk(demuxer, "ICCP", 1, &chunk_iter); int result = WebPDemuxGetChunk(demuxer, "ICCP", 1, &chunk_iter);
if (result) { if (result) {
NSData *profileData = [NSData dataWithBytesNoCopy:(void *)chunk_iter.chunk.bytes length:chunk_iter.chunk.size freeWhenDone:NO]; NSData *profileData = [NSData dataWithBytesNoCopy:(void *)chunk_iter.chunk.bytes length:chunk_iter.chunk.size freeWhenDone:NO];
colorSpaceRef = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)profileData); colorSpaceRef = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)profileData);
} }
WebPDemuxReleaseChunkIterator(&chunk_iter); WebPDemuxReleaseChunkIterator(&chunk_iter);
if (!colorSpaceRef) { if (!colorSpaceRef) {
colorSpaceRef = SDCGColorSpaceGetDeviceRGB(); colorSpaceRef = SDCGColorSpaceGetDeviceRGB();
CGColorSpaceRetain(colorSpaceRef); CGColorSpaceRetain(colorSpaceRef);
} }
return colorSpaceRef; return colorSpaceRef;
} }
@implementation SDWebImageWebPCoder { @implementation SDWebImageWebPCoder {
@ -111,15 +111,15 @@ static CGColorSpaceRef SDColorSpaceCreateWithDemuxer(WebPDemuxer *demuxer) {
WebPDemuxDelete(demuxer); WebPDemuxDelete(demuxer);
return nil; return nil;
} }
CGColorSpaceRef colorSpace = NULL; CGColorSpaceRef colorSpace = NULL;
// ICC profile // ICC profile
if (flags & ICCP_FLAG) { if (flags & ICCP_FLAG) {
colorSpace = SDColorSpaceCreateWithDemuxer(demuxer); colorSpace = SDColorSpaceCreateWithDemuxer(demuxer);
} else { } else {
colorSpace = SDCGColorSpaceGetDeviceRGB(); colorSpace = SDCGColorSpaceGetDeviceRGB();
CGColorSpaceRetain(colorSpace); CGColorSpaceRetain(colorSpace);
} }
if (!(flags & ANIMATION_FLAG)) { if (!(flags & ANIMATION_FLAG)) {
// for static single webp image // for static single webp image