From 06de4e6fe6b810f56e668b03aae1dd120f32daae Mon Sep 17 00:00:00 2001 From: Marco Zandonadi Date: Mon, 24 Jun 2019 20:15:02 -0700 Subject: [PATCH] Fixed duplicate symbol in RCTAnimatedImage.h fbshipit-source-id: 4db59f986a35a62a8c72cd6bc508ec1688e7b11d --- Libraries/Image/RCTAnimatedImage.m | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Libraries/Image/RCTAnimatedImage.m b/Libraries/Image/RCTAnimatedImage.m index bfb4ca5a4d6..004ba90b2c7 100644 --- a/Libraries/Image/RCTAnimatedImage.m +++ b/Libraries/Image/RCTAnimatedImage.m @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +#import #import "RCTAnimatedImage.h" @interface RCTGIFCoderFrame : NSObject @@ -32,25 +33,25 @@ 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; } @@ -62,18 +63,18 @@ 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; } @@ -100,7 +101,7 @@ } NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; - + NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; if (delayTimeUnclampedProp != nil) { frameDuration = [delayTimeUnclampedProp floatValue]; @@ -110,7 +111,7 @@ frameDuration = [delayTimeProp floatValue]; } } - + CFRelease(cfFrameProperties); return frameDuration; }