update: latest source changes

This commit is contained in:
2026-05-31 20:50:37 +02:00
parent 858674c9d4
commit d88187be16
156 changed files with 11885 additions and 4 deletions
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2024-present 650 Industries. All rights reserved.
import SDWebImage
/**
Custom `SDAnimatedImage` that fixes issues with `images` and `duration` not being available.
*/
final class AnimatedImage: SDAnimatedImage {
var frames: [SDImageFrame]?
// MARK: - UIImage
override var images: [UIImage]? {
preloadAllFrames()
return frames?.map({ $0.image })
}
override var duration: TimeInterval {
preloadAllFrames()
return frames?.reduce(0, { $0 + $1.duration }) ?? 0.0
}
// MARK: - SDAnimatedImage
override func preloadAllFrames() {
if frames != nil {
return
}
frames = [UInt](0..<animatedImageFrameCount).compactMap { index in
guard let image = animatedImageFrame(at: index) else {
return nil
}
let duration = animatedImageDuration(at: index)
return SDImageFrame(image: image, duration: duration)
}
}
}