Ensure constant bubble sizes for visual media.
This commit is contained in:
parent
c180d20dcd
commit
14e7274c3d
|
@ -1027,8 +1027,7 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
|
|||
if (self.viewItem.mediaAlbumItems.count == 1) {
|
||||
// Honor the content aspect ratio for single media.
|
||||
ConversationMediaAlbumItem *mediaAlbumItem = self.viewItem.mediaAlbumItems.firstObject;
|
||||
if (mediaAlbumItem.attachmentStream && mediaAlbumItem.mediaSize.width > 0
|
||||
&& mediaAlbumItem.mediaSize.height > 0) {
|
||||
if (mediaAlbumItem.mediaSize.width > 0 && mediaAlbumItem.mediaSize.height > 0) {
|
||||
CGSize mediaSize = mediaAlbumItem.mediaSize;
|
||||
CGFloat contentAspectRatio = mediaSize.width / mediaSize.height;
|
||||
// Clamp the aspect ratio so that very thin/wide content is presented
|
||||
|
|
|
@ -704,10 +704,15 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
: nil);
|
||||
|
||||
if (![attachment isKindOfClass:[TSAttachmentStream class]]) {
|
||||
TSAttachmentPointer *attachmentPointer = (TSAttachmentPointer *)attachment;
|
||||
CGSize mediaSize = CGSizeZero;
|
||||
if (attachmentPointer.mediaSize.width > 0 && attachmentPointer.mediaSize.height > 0) {
|
||||
mediaSize = attachmentPointer.mediaSize;
|
||||
}
|
||||
[mediaAlbumItems addObject:[[ConversationMediaAlbumItem alloc] initWithAttachment:attachment
|
||||
attachmentStream:nil
|
||||
caption:caption
|
||||
mediaSize:CGSizeZero]];
|
||||
mediaSize:mediaSize]];
|
||||
continue;
|
||||
}
|
||||
TSAttachmentStream *attachmentStream = (TSAttachmentStream *)attachment;
|
||||
|
|
Loading…
Reference in New Issue