mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix image loop counter on iOS 14 (#30744)
Summary: Animated gifs, which do not loop, currently animate twice on iOS 14. See: https://github.com/facebook/react-native/issues/30147 ## Changelog [iOS] [Fixed] - Animated images without loop no longer animate twice Pull Request resolved: https://github.com/facebook/react-native/pull/30744 Test Plan: Run the example app with any animated gif. I attached a gif, which is affected.  Reviewed By: sammy-SC Differential Revision: D25977626 Pulled By: PeteTheHeat fbshipit-source-id: 889d4a7bed8f7a7be6a9a427501d0071b7c02b8c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
768ecc2906
commit
17aa1e320e
@@ -87,9 +87,12 @@
|
||||
NSNumber *gifLoopCount = gifProperties[(__bridge NSString *)kCGImagePropertyGIFLoopCount];
|
||||
if (gifLoopCount != nil) {
|
||||
loopCount = gifLoopCount.unsignedIntegerValue;
|
||||
// A loop count of 1 means it should repeat twice, 2 means, thrice, etc.
|
||||
if (loopCount != 0) {
|
||||
loopCount++;
|
||||
if (@available(iOS 14, *)) {
|
||||
} else {
|
||||
// A loop count of 1 means it should animate twice, 2 means, thrice, etc.
|
||||
if (loopCount != 0) {
|
||||
loopCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user