From a26adfd351727aae830ccbcdde26a8633b7e5ffd Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Wed, 24 Jan 2024 11:12:34 +0000 Subject: [PATCH] try extracting only the first frame --- .../KukaiCoreSwift/Services/MediaProxyService.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/KukaiCoreSwift/Services/MediaProxyService.swift b/Sources/KukaiCoreSwift/Services/MediaProxyService.swift index 71df5a00..3f1ee08c 100644 --- a/Sources/KukaiCoreSwift/Services/MediaProxyService.swift +++ b/Sources/KukaiCoreSwift/Services/MediaProxyService.swift @@ -375,11 +375,13 @@ public class MediaProxyService: NSObject { imageView.image = fallback } - if image?.sd_isAnimated == true, let maxMemory = maxAnimatedImageSize, (image?.sd_memoryCost ?? 0) > maxMemory, let animatedImageView = imageView as? SDAnimatedImageView { - animatedImageView.autoPlayAnimatedImage = false + if image?.sd_isAnimated == true, let maxMemory = maxAnimatedImageSize, (image?.sd_memoryCost ?? 0) > maxMemory/*, let animatedImageView = imageView as? SDAnimatedImageView*/ /*let aniamtedImage = SDAnimatedImage*/ { + //animatedImageView.autoPlayAnimatedImage = false + imageView.image = image?.images?.first + } else { + imageView.image = image } - - imageView.image = image + completion?(image?.size) } }