@@ -183,12 +183,8 @@ + (NSUInteger)imageLoopCountWithSource:(CGImageSourceRef)source {
183
183
}
184
184
185
185
+ (NSTimeInterval )frameDurationAtIndex : (NSUInteger )index source : (CGImageSourceRef)source {
186
- NSDictionary *options = @{
187
- (__bridge NSString *)kCGImageSourceShouldCacheImmediately : @(YES ),
188
- (__bridge NSString *)kCGImageSourceShouldCache : @(YES ) // Always cache to reduce CPU usage
189
- };
190
186
NSTimeInterval frameDuration = 0.1 ;
191
- CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex (source, index, (__bridge CFDictionaryRef)options );
187
+ CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex (source, index, NULL );
192
188
if (!cfFrameProperties) {
193
189
return frameDuration;
194
190
}
@@ -234,9 +230,8 @@ + (UIImage *)createFrameAtIndex:(NSUInteger)index source:(CGImageSourceRef)sourc
234
230
};
235
231
}
236
232
}
237
- // Some options need to pass to `CGImageSourceCopyPropertiesAtIndex` before `CGImageSourceCreateImageAtIndex`, or ImageIO will ignore them because they parse once :)
238
233
// Parse the image properties
239
- NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex (source, index, (__bridge CFDictionaryRef)options );
234
+ NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex (source, index, NULL );
240
235
CGFloat pixelWidth = [properties[(__bridge NSString *)kCGImagePropertyPixelWidth ] doubleValue ];
241
236
CGFloat pixelHeight = [properties[(__bridge NSString *)kCGImagePropertyPixelHeight ] doubleValue ];
242
237
CGImagePropertyOrientation exifOrientation = (CGImagePropertyOrientation)[properties[(__bridge NSString *)kCGImagePropertyOrientation ] unsignedIntegerValue ];
@@ -515,11 +510,7 @@ - (void)updateIncrementalData:(NSData *)data finished:(BOOL)finished {
515
510
CGImageSourceUpdateData (_imageSource, (__bridge CFDataRef)data, finished);
516
511
517
512
if (_width + _height == 0 ) {
518
- NSDictionary *options = @{
519
- (__bridge NSString *)kCGImageSourceShouldCacheImmediately : @(YES ),
520
- (__bridge NSString *)kCGImageSourceShouldCache : @(YES ) // Always cache to reduce CPU usage
521
- };
522
- CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex (_imageSource, 0 , (__bridge CFDictionaryRef)options);
513
+ CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex (_imageSource, 0 , NULL );
523
514
if (properties) {
524
515
CFTypeRef val = CFDictionaryGetValue (properties, kCGImagePropertyPixelHeight );
525
516
if (val) CFNumberGetValue (val, kCFNumberLongType , &_height);
0 commit comments