Skip to content

Commit 728a35f

Browse files
chrisnojimafacebook-github-bot
authored andcommittedJan 16, 2019
fix incorrect type which makes animated gifs not loop forever on device (#22987)
Summary: #22985 This 1 liner fixes the animation looping being broken on ios devices. The original source of the bug is here: 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: #22987 Differential Revision: D13682645 Pulled By: hramos fbshipit-source-id: 96b0602b418e3ebe369427a24777cd4374ac5d48
1 parent 3654b9e commit 728a35f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎Libraries/Image/RCTGIFImageDecoder.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData
3232
{
3333
CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)imageData, NULL);
3434
NSDictionary<NSString *, id> *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL);
35-
NSUInteger loopCount = 0;
35+
CGFloat loopCount = 0;
3636
if ([[properties[(id)kCGImagePropertyGIFDictionary] allKeys] containsObject:(id)kCGImagePropertyGIFLoopCount]) {
3737
loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue];
3838
if (loopCount == 0) {
@@ -43,7 +43,7 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData
4343
loopCount += 1;
4444
}
4545
}
46-
46+
4747
UIImage *image = nil;
4848
size_t imageCount = CGImageSourceGetCount(imageSource);
4949
if (imageCount > 1) {

0 commit comments

Comments
 (0)
Please sign in to comment.