mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix incorrect type which makes animated gifs not loop forever on device (#22987)
Summary: https://github.com/facebook/react-native/issues/22985 This 1 liner fixes the animation looping being broken on ios devices. The original source of the bug is here: https://github.com/facebook/react-native/commit/95ef882#diff-e57b12f931820d7e0949e5cbb2701dcfR35 We set the value to a special large float, and assign it to repeatCount which is also a float, so this should be a float. Changelog: [iOS] [Fixed] - Fix animated GIFs not looping forever Pull Request resolved: https://github.com/facebook/react-native/pull/22987 Differential Revision: D13682645 Pulled By: hramos fbshipit-source-id: 96b0602b418e3ebe369427a24777cd4374ac5d48
This commit is contained in:
committed by
Mike Grabowski
parent
0bb1ba8ad5
commit
5e875474ef
@@ -32,7 +32,7 @@ RCT_EXPORT_MODULE()
|
||||
{
|
||||
CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)imageData, NULL);
|
||||
NSDictionary<NSString *, id> *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL);
|
||||
NSUInteger loopCount = 0;
|
||||
CGFloat loopCount = 0;
|
||||
if ([[properties[(id)kCGImagePropertyGIFDictionary] allKeys] containsObject:(id)kCGImagePropertyGIFLoopCount]) {
|
||||
loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue];
|
||||
if (loopCount == 0) {
|
||||
@@ -43,7 +43,7 @@ RCT_EXPORT_MODULE()
|
||||
loopCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UIImage *image = nil;
|
||||
size_t imageCount = CGImageSourceGetCount(imageSource);
|
||||
if (imageCount > 1) {
|
||||
|
||||
Reference in New Issue
Block a user