Fixes #2253 - Fix timeline thumbnail frames for media missing sizing info

This commit is contained in:
Stefan Ceriu
2023-12-18 12:05:58 +00:00
committed by GitHub
parent 123164f398
commit b1b8bbcd73
5 changed files with 16 additions and 10 deletions
@@ -27,10 +27,15 @@ extension View {
aspectRatio(contentAspectRatio, contentMode: .fit) aspectRatio(contentAspectRatio, contentMode: .fit)
.frame(minHeight: minMediaHeight, maxHeight: minMediaHeight) .frame(minHeight: minMediaHeight, maxHeight: minMediaHeight)
} else { } else {
if let contentAspectRatio {
aspectRatio(contentAspectRatio, contentMode: .fit) aspectRatio(contentAspectRatio, contentMode: .fit)
.frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity))) .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. // Required to prevent the reply details to get higher priority in rendering the width of the view.
.aspectRatio(contentAspectRatio, contentMode: .fit) .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)
}
} }
} }
} }
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:c1601948825e15b538825f9696f498d1331f766de087e99770ce8d8c12c8486c oid sha256:3b7f3850adbd86bd98abaa8ddd301fa0e6dba20a2c4f8274d4854b6d03dd1973
size 607660 size 599565
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:a762de5fa3e74880e1c7a723b1ad24273dbc897d3c3a5ae0df04180846ff79aa oid sha256:026370163e3eadce4f84229ee849e144e68057557e0566888217742745730e02
size 300803 size 300921
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:75cb1a102958d7b034d171f216fc83a42d0bd1112c9e08e6e4c9c0476552196f oid sha256:ef90ba75f3aa94a240d48fb83ebdec8e660da261dfe2f3ddbf8878a705a6a58f
size 76152 size 76597
+1
View File
@@ -0,0 +1 @@
Fix timeline thumbnail frames for media missing sizing info