Remove kCGImageSourceShouldCache option when create image source

This commit is contained in:
zhongwuzw 2018-09-05 22:07:34 +08:00
parent 0f14258e83
commit b1b48cca81
2 changed files with 2 additions and 4 deletions

View File

@ -326,8 +326,7 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef
} }
self = [super init]; self = [super init];
if (self) { if (self) {
// use Image/IO cache because it's already keep a balance between CPU & memory CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageSourceShouldCache : @(YES)});
if (!imageSource) { if (!imageSource) {
return nil; return nil;
} }

View File

@ -327,8 +327,7 @@
} }
self = [super init]; self = [super init];
if (self) { if (self) {
// use Image/IO cache because it's already keep a balance between CPU & memory CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageSourceShouldCache : @(YES)});
if (!imageSource) { if (!imageSource) {
return nil; return nil;
} }