From 1509ed555f7b613a2a54f5494797db4c8907525c Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Sun, 28 Jul 2019 13:11:51 -0400 Subject: [PATCH] Revert "Fixed duplicate symbol in RCTAnimatedImage.h" This reverts commit 06de4e6fe6b810f56e668b03aae1dd120f32daae. --- Libraries/Image/RCTAnimatedImage.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Libraries/Image/RCTAnimatedImage.m b/Libraries/Image/RCTAnimatedImage.m index 2cabc1c648e9a3..d9589b2a2163eb 100644 --- a/Libraries/Image/RCTAnimatedImage.m +++ b/Libraries/Image/RCTAnimatedImage.m @@ -33,25 +33,25 @@ - (instancetype)initWithData:(NSData *)data scale:(CGFloat)scale if (!imageSource) { return nil; } - + BOOL framesValid = [self scanAndCheckFramesValidWithSource:imageSource]; if (!framesValid) { CFRelease(imageSource); return nil; } - + _imageSource = imageSource; - + // grab image at the first index UIImage *image = [self animatedImageFrameAtIndex:0]; if (!image) { return nil; } self = [super initWithCGImage:image.CGImage scale:MAX(scale, 1) orientation:image.imageOrientation]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; } - + return self; } @@ -63,18 +63,18 @@ - (BOOL)scanAndCheckFramesValidWithSource:(CGImageSourceRef)imageSource NSUInteger frameCount = CGImageSourceGetCount(imageSource); NSUInteger loopCount = [self imageLoopCountWithSource:imageSource]; NSMutableArray *frames = [NSMutableArray array]; - + for (size_t i = 0; i < frameCount; i++) { RCTGIFCoderFrame *frame = [[RCTGIFCoderFrame alloc] init]; frame.index = i; frame.duration = [self frameDurationAtIndex:i source:imageSource]; [frames addObject:frame]; } - + _frameCount = frameCount; _loopCount = loopCount; _frames = [frames copy]; - + return YES; } @@ -101,7 +101,7 @@ - (float)frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source } NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; - + NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; if (delayTimeUnclampedProp != nil) { frameDuration = [delayTimeUnclampedProp floatValue]; @@ -111,7 +111,7 @@ - (float)frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source frameDuration = [delayTimeProp floatValue]; } } - + CFRelease(cfFrameProperties); return frameDuration; }