58 lines
1.2 KiB
Objective-C
58 lines
1.2 KiB
Objective-C
/*
|
|
* This file is part of the SDWebImage package.
|
|
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
#import "SDImageGIFCoder.h"
|
|
#if SD_MAC
|
|
#import <CoreServices/CoreServices.h>
|
|
#else
|
|
#import <MobileCoreServices/MobileCoreServices.h>
|
|
#endif
|
|
|
|
@implementation SDImageGIFCoder
|
|
|
|
+ (instancetype)sharedCoder {
|
|
static SDImageGIFCoder *coder;
|
|
static dispatch_once_t onceToken;
|
|
dispatch_once(&onceToken, ^{
|
|
coder = [[SDImageGIFCoder alloc] init];
|
|
});
|
|
return coder;
|
|
}
|
|
|
|
#pragma mark - Subclass Override
|
|
|
|
+ (SDImageFormat)imageFormat {
|
|
return SDImageFormatGIF;
|
|
}
|
|
|
|
+ (NSString *)imageUTType {
|
|
return (__bridge NSString *)kUTTypeGIF;
|
|
}
|
|
|
|
+ (NSString *)dictionaryProperty {
|
|
return (__bridge NSString *)kCGImagePropertyGIFDictionary;
|
|
}
|
|
|
|
+ (NSString *)unclampedDelayTimeProperty {
|
|
return (__bridge NSString *)kCGImagePropertyGIFUnclampedDelayTime;
|
|
}
|
|
|
|
+ (NSString *)delayTimeProperty {
|
|
return (__bridge NSString *)kCGImagePropertyGIFDelayTime;
|
|
}
|
|
|
|
+ (NSString *)loopCountProperty {
|
|
return (__bridge NSString *)kCGImagePropertyGIFLoopCount;
|
|
}
|
|
|
|
+ (NSUInteger)defaultLoopCount {
|
|
return 1;
|
|
}
|
|
|
|
@end
|