diff --git a/damus/Components/ImageCarousel.swift b/damus/Components/ImageCarousel.swift index 9cd0f7b5..0f8f9ccb 100644 --- a/damus/Components/ImageCarousel.swift +++ b/damus/Components/ImageCarousel.swift @@ -17,11 +17,14 @@ struct ImageViewer: View { VStack{ Text(url.lastPathComponent) - KFImage(url) + KFAnimatedImage(url) + .configure { view in + view.framePreloadCount = 3 + } + .cacheOriginalImage() .loadDiskFileSynchronously() .scaleFactor(UIScreen.main.scale) .fade(duration: 0.1) - .resizable() .aspectRatio(contentMode: .fit) .tabItem { Text(url.absoluteString) @@ -43,11 +46,14 @@ struct ImageCarousel: View { var body: some View { TabView { ForEach(urls, id: \.absoluteString) { url in - KFImage(url) + KFAnimatedImage(url) + .configure { view in + view.framePreloadCount = 3 + } + .cacheOriginalImage() .loadDiskFileSynchronously() .scaleFactor(UIScreen.main.scale) .fade(duration: 0.1) - .resizable() .aspectRatio(contentMode: .fit) .tabItem { Text(url.absoluteString) diff --git a/damus/Views/ProfilePicView.swift b/damus/Views/ProfilePicView.swift index d1f9ce13..d7c0f55c 100644 --- a/damus/Views/ProfilePicView.swift +++ b/damus/Views/ProfilePicView.swift @@ -56,16 +56,19 @@ struct ProfilePicView: View { Group { let pic = picture ?? profiles.lookup(id: pubkey)?.picture ?? robohash(pubkey) let url = URL(string: pic) - let processor = ResizingImageProcessor(referenceSize: CGSize(width: size, height: size)) - KFImage.url(url) + KFAnimatedImage(url) + .configure { view in + view.framePreloadCount = 1 + } .placeholder { _ in Placeholder } - .setProcessor(processor) + .cacheOriginalImage() .scaleFactor(UIScreen.main.scale) .loadDiskFileSynchronously() .fade(duration: 0.1) + .frame(width: size, height: size) .clipShape(Circle()) .overlay(Circle().stroke(highlight_color(highlight), lineWidth: pfp_line_width(highlight))) }