diff --git a/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift b/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift index db6d1de23..a5d709261 100644 --- a/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift +++ b/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift @@ -27,10 +27,15 @@ extension View { aspectRatio(contentAspectRatio, contentMode: .fit) .frame(minHeight: minMediaHeight, maxHeight: minMediaHeight) } else { - aspectRatio(contentAspectRatio, contentMode: .fit) - .frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity))) - // Required to prevent the reply details to get higher priority in rendering the width of the view. - .aspectRatio(contentAspectRatio, contentMode: .fit) + if let contentAspectRatio { + aspectRatio(contentAspectRatio, contentMode: .fit) + .frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity))) + // Required to prevent the reply details to get higher priority in rendering the width of the view. + .aspectRatio(contentAspectRatio, contentMode: .fit) + } else { // Otherwise let the image load and use its native aspect ratio with a max height + aspectRatio(contentMode: .fit) + .frame(maxHeight: maxMediaHeight) + } } } } diff --git a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView.Thread-decorator.png b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView.Thread-decorator.png index 112e49809..abec88e77 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView.Thread-decorator.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView.Thread-decorator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1601948825e15b538825f9696f498d1331f766de087e99770ce8d8c12c8486c -size 607660 +oid sha256:3b7f3850adbd86bd98abaa8ddd301fa0e6dba20a2c4f8274d4854b6d03dd1973 +size 599565 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemPlainStylerView.Threads.png b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemPlainStylerView.Threads.png index d7b00f15d..52104df88 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemPlainStylerView.Threads.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemPlainStylerView.Threads.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a762de5fa3e74880e1c7a723b1ad24273dbc897d3c3a5ae0df04180846ff79aa -size 300803 +oid sha256:026370163e3eadce4f84229ee849e144e68057557e0566888217742745730e02 +size 300921 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_videoRoomTimelineView.1.png b/UnitTests/__Snapshots__/PreviewTests/test_videoRoomTimelineView.1.png index 48b98ba63..6c6021f79 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_videoRoomTimelineView.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_videoRoomTimelineView.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:75cb1a102958d7b034d171f216fc83a42d0bd1112c9e08e6e4c9c0476552196f -size 76152 +oid sha256:ef90ba75f3aa94a240d48fb83ebdec8e660da261dfe2f3ddbf8878a705a6a58f +size 76597 diff --git a/changelog.d/2253.bugfix b/changelog.d/2253.bugfix new file mode 100644 index 000000000..539fd9ac9 --- /dev/null +++ b/changelog.d/2253.bugfix @@ -0,0 +1 @@ +Fix timeline thumbnail frames for media missing sizing info \ No newline at end of file