Commit 5b0e44c 1 parent e711bb7 commit 5b0e44c Copy full SHA for 5b0e44c
File tree 2 files changed +16
-5
lines changed
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 6
6
Pod ::Spec . new do |s |
7
7
8
8
s . name = "MMMLoadable"
9
- s . version = "2.2.1 "
9
+ s . version = "2.2.2 "
10
10
s . summary = "A simple model for async calculations"
11
11
s . description = "#{ s . summary } ."
12
12
s . homepage = "https://github.com/mediamonks/#{ s . name } "
Original file line number Diff line number Diff line change @@ -224,17 +224,28 @@ - (NSNumber *)imageAnimationDelayTime:(CGImageSourceRef)source {
224
224
return nil ;
225
225
}
226
226
NSDictionary *gifProps = (__bridge NSDictionary *)(CFDictionaryRef )CFDictionaryGetValue (props, kCGImagePropertyGIFDictionary );
227
- NSDictionary *webpProps = (__bridge NSDictionary *)(CFDictionaryRef )CFDictionaryGetValue (props, kCGImagePropertyWebPDictionary );
228
- CFRelease (props);
229
227
if (gifProps) {
228
+ CFRelease (props);
230
229
return (NSNumber *)gifProps[(NSString *)kCGImagePropertyGIFDelayTime ];
231
- } else if (webpProps) {
230
+ } else if (@available (iOS 14.0 , *)) {
231
+ return [self webpAnimationDelayTime: props];
232
+ } else {
233
+ CFRelease (props);
234
+ return nil ;
235
+ }
236
+ }
237
+
238
+ - (NSNumber *)webpAnimationDelayTime: (CFDictionaryRef )props API_AVAILABLE (ios(14 )) {
239
+ NSDictionary *webpProps = (__bridge NSDictionary *)(CFDictionaryRef )CFDictionaryGetValue (props, kCGImagePropertyWebPDictionary );
240
+ CFRelease (props);
241
+ if (webpProps) {
232
242
return (NSNumber *)webpProps[(NSString *)kCGImagePropertyWebPDelayTime ];
233
243
} else {
234
244
return nil ;
235
245
}
236
246
}
237
247
248
+
238
249
// / [UIImage imageWithData:] does not decode GIFs as animated images, this is to correct that.
239
250
- (UIImage *)imageWithData:(NSData *)data {
240
251
@@ -270,7 +281,7 @@ - (UIImage *)imageWithData:(NSData *)data {
270
281
[images addObject: image];
271
282
}
272
283
273
- NSTimeInterval delayTime = MAX ([delayTimeNum doubleValue ], 0.1 );
284
+ NSTimeInterval delayTime = MAX ([delayTimeNum doubleValue ], 0.04 );
274
285
275
286
UIImage *result = [UIImage animatedImageWithImages: images duration: delayTime * count];
276
287
You can’t perform that action at this time.
0 commit comments