Add attachment onto iOS attachment

This commit is contained in:
2024-12-21 16:56:55 +08:00
parent f5c06bc89c
commit dc78f39969
2 changed files with 53 additions and 38 deletions

View File

@ -73,10 +73,11 @@ struct RandomPostWidgetEntryView : View {
if let avatar = randomPost.publisher.avatar {
let avatarUrl = getAttachmentUrl(for: avatar)
let size: CGFloat = 28
let scaleProcessor = ResizingImageProcessor(referenceSize: CGSize(width: size, height: size), mode: .aspectFit)
KFImage.url(URL(string: avatarUrl))
.resizable()
.setProcessor(DownsamplingImageProcessor(size: CGSize(width: size, height: size)))
.setProcessor(scaleProcessor)
.transition(.opacity)
.aspectRatio(contentMode: .fit)
.frame(width: size, height: size)