When converting Gif to an animated UIImage, the delay for each frame is extracted from the kCGImagePropertyGIFDelayTime or kCGImagePropertyGIFUnclampedDelayTime
Same:
NSString *frameKeyPath = [NSString stringWithFormat:@"%@.%@",(NSString*)kCGImagePropertyGIFDictionary,kCGImagePropertyGIFUnclampedDelayTime]; CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source,i,nil); NSDictionary *frameProperties = (__bridge NSDictionary*)cfFrameProperties; NSNumber *delayTimeProp = [frameProperties valueForKeyPath:frameKeyPath];
Chrome selects the correct one in both examples:
kCGImagePropertyGIFDelayTime = 0.1: http://i.imgur.com/tX9cjUO.gif
kCGImagePropertyGIFUnclampedDelayTime = 0.01: http://i.minus.com/iIOyK7SKp8TYc.gif
Choosing one for each case leads to one of the examples of image animation being too slow or too fast.
Is there a way to determine which property to use?
thanks
source share