Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 6276dcb34c
commit 119f1f3429

@ -7,6 +7,7 @@
#import "FLAnimatedImage.h" #import "FLAnimatedImage.h"
#import "JSQMediaItem+OWS.h" #import "JSQMediaItem+OWS.h"
#import "TSAttachmentStream.h" #import "TSAttachmentStream.h"
#import "UIColor+OWS.h"
#import <AssetsLibrary/AssetsLibrary.h> #import <AssetsLibrary/AssetsLibrary.h>
#import <JSQMessagesViewController/JSQMessagesMediaViewBubbleImageMasker.h> #import <JSQMessagesViewController/JSQMessagesMediaViewBubbleImageMasker.h>
#import <MobileCoreServices/MobileCoreServices.h> #import <MobileCoreServices/MobileCoreServices.h>
@ -103,7 +104,9 @@ NS_ASSUME_NONNULL_BEGIN
NSData *fileData = [NSData dataWithContentsOfURL:[self.attachment mediaURL]]; NSData *fileData = [NSData dataWithContentsOfURL:[self.attachment mediaURL]];
if (!fileData) { if (!fileData) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]); DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
return [UIView new]; UIView *view = [UIView new];
view.backgroundColor = [UIColor colorWithWhite:0.85f alpha:1.f];
return view;
} }
FLAnimatedImage *animatedGif = [FLAnimatedImage animatedImageWithGIFData:fileData]; FLAnimatedImage *animatedGif = [FLAnimatedImage animatedImageWithGIFData:fileData];
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init]; FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];

@ -6,6 +6,7 @@
#import "AttachmentUploadView.h" #import "AttachmentUploadView.h"
#import "JSQMediaItem+OWS.h" #import "JSQMediaItem+OWS.h"
#import "TSAttachmentStream.h" #import "TSAttachmentStream.h"
#import "UIColor+OWS.h"
#import <AssetsLibrary/AssetsLibrary.h> #import <AssetsLibrary/AssetsLibrary.h>
#import <JSQMessagesViewController/JSQMessagesMediaViewBubbleImageMasker.h> #import <JSQMessagesViewController/JSQMessagesMediaViewBubbleImageMasker.h>
#import <MobileCoreServices/MobileCoreServices.h> #import <MobileCoreServices/MobileCoreServices.h>
@ -75,7 +76,9 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *image = self.attachment.image; UIImage *image = self.attachment.image;
if (!image) { if (!image) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]); DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
return [UIView new]; UIView *view = [UIView new];
view.backgroundColor = [UIColor colorWithWhite:0.85f alpha:1.f];
return view;
} }
CGSize size = [self mediaViewDisplaySize]; CGSize size = [self mediaViewDisplaySize];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

@ -227,7 +227,9 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *image = self.attachment.image; UIImage *image = self.attachment.image;
if (!image) { if (!image) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]); DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
return [UIView new]; UIView *view = [UIView new];
view.backgroundColor = [UIColor colorWithWhite:0.85f alpha:1.f];
return view;
} }
UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.contentMode = UIViewContentModeScaleAspectFill; imageView.contentMode = UIViewContentModeScaleAspectFill;

Loading…
Cancel
Save