Merge pull request #2863 from dreampiggy/bugfix_revert_apng_constants
Revert the change for APNG constants fix for iOS 8 devices which cause crash
This commit is contained in:
commit
6d67ed0143
|
@ -14,20 +14,15 @@
|
|||
#endif
|
||||
|
||||
// iOS 8 Image/IO framework binary does not contains these APNG contants, so we define them. Thanks Apple :)
|
||||
static NSString * kSDCGImagePropertyAPNGLoopCount = @"LoopCount";
|
||||
static NSString * kSDCGImagePropertyAPNGDelayTime = @"DelayTime";
|
||||
static NSString * kSDCGImagePropertyAPNGUnclampedDelayTime = @"UnclampedDelayTime";
|
||||
// We can not use runtime @available check for this issue, because it's a global symbol and should be loaded during launch time by dyld. So hack if the min deployment target version < iOS 9.0, whatever it running on iOS 9+ or not.
|
||||
#if (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
|
||||
const CFStringRef kCGImagePropertyAPNGLoopCount = (__bridge CFStringRef)@"LoopCount";
|
||||
const CFStringRef kCGImagePropertyAPNGDelayTime = (__bridge CFStringRef)@"DelayTime";
|
||||
const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef)@"UnclampedDelayTime";
|
||||
#endif
|
||||
|
||||
@implementation SDImageAPNGCoder
|
||||
|
||||
+ (void)initialize {
|
||||
if (@available(iOS 9, *)) {
|
||||
kSDCGImagePropertyAPNGLoopCount = (__bridge NSString *)kCGImagePropertyAPNGLoopCount;
|
||||
kSDCGImagePropertyAPNGDelayTime = (__bridge NSString *)kCGImagePropertyAPNGDelayTime;
|
||||
kSDCGImagePropertyAPNGUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime;
|
||||
}
|
||||
}
|
||||
|
||||
+ (instancetype)sharedCoder {
|
||||
static SDImageAPNGCoder *coder;
|
||||
static dispatch_once_t onceToken;
|
||||
|
@ -52,15 +47,15 @@ static NSString * kSDCGImagePropertyAPNGUnclampedDelayTime = @"UnclampedDelayTim
|
|||
}
|
||||
|
||||
+ (NSString *)unclampedDelayTimeProperty {
|
||||
return kSDCGImagePropertyAPNGUnclampedDelayTime;
|
||||
return (__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime;
|
||||
}
|
||||
|
||||
+ (NSString *)delayTimeProperty {
|
||||
return kSDCGImagePropertyAPNGDelayTime;
|
||||
return (__bridge NSString *)kCGImagePropertyAPNGDelayTime;
|
||||
}
|
||||
|
||||
+ (NSString *)loopCountProperty {
|
||||
return kSDCGImagePropertyAPNGLoopCount;
|
||||
return (__bridge NSString *)kCGImagePropertyAPNGLoopCount;
|
||||
}
|
||||
|
||||
+ (NSUInteger)defaultLoopCount {
|
||||
|
|
Loading…
Reference in New Issue