Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent a2fe4dbe39
commit 9fefdd2e2c

@ -42,7 +42,7 @@ typedef NS_ENUM(NSInteger, ImageFormat) {
return NO; return NO;
} }
if (![self ows_hasValidImageDimensions:isAnimated]) { if (![self ows_hasValidImageDimensionsWithIsAnimated:isAnimated]) {
return NO; return NO;
} }
@ -65,9 +65,8 @@ typedef NS_ENUM(NSInteger, ImageFormat) {
return NO; return NO;
} }
BOOL isAnimated = NO; BOOL isAnimated = [MIMETypeUtil isSupportedAnimatedMIMEType:mimeType];
if ([MIMETypeUtil isSupportedAnimatedMIMEType:mimeType]) { if (isAnimated) {
isAnimated = YES;
if (fileSize.unsignedIntegerValue > OWSMediaUtils.kMaxFileSizeAnimatedImage) { if (fileSize.unsignedIntegerValue > OWSMediaUtils.kMaxFileSizeAnimatedImage) {
DDLogWarn(@"Oversize animated image."); DDLogWarn(@"Oversize animated image.");
return NO; return NO;
@ -101,7 +100,7 @@ typedef NS_ENUM(NSInteger, ImageFormat) {
return YES; return YES;
} }
- (BOOL)ows_hasValidImageDimensions:(BOOL)isAnimated - (BOOL)ows_hasValidImageDimensionsWithIsAnimated:(BOOL)isAnimated
{ {
CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)self, NULL); CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)self, NULL);
if (imageSource == NULL) { if (imageSource == NULL) {

Loading…
Cancel
Save