Skip to content

Commit c92240b

Browse files
committed
Disable the WebImage progressive animation support, which is complicated, use AnimatedImage instead
1 parent f720881 commit c92240b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

SDWebImageSwiftUI/Classes/WebImage.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public struct WebImage : View {
2828
@State var currentFrame: PlatformImage? = nil
2929
@State var imagePlayer: SDAnimatedImagePlayer? = nil
3030

31-
var incrementalLoad: Bool = true
3231
var maxBufferSize: UInt?
3332
var customLoopCount: UInt?
3433
var runLoopMode: RunLoop.Mode = .common
@@ -67,7 +66,7 @@ public struct WebImage : View {
6766
public var body: some View {
6867
Group {
6968
if imageManager.image != nil {
70-
if isAnimating {
69+
if isAnimating && !self.imageManager.isIncremental {
7170
if currentFrame != nil {
7271
configurations.reduce(Image(platformImage: currentFrame!)) { (previous, configuration) in
7372
configuration(previous)
@@ -314,16 +313,6 @@ extension WebImage {
314313
return result
315314
}
316315

317-
/// Whehter or not to enable incremental image load for animated image. See `SDAnimatedImageView` for detailed explanation for this.
318-
/// - Note: If you are confused about this description, open Chrome browser to view some large GIF images with low network speed to see the animation behavior.
319-
/// Default is true. Set to false to only render the static poster for incremental animated image.
320-
/// - Parameter incrementalLoad: Whether or not to incremental load
321-
public func incrementalLoad(_ incrementalLoad: Bool) -> WebImage {
322-
var result = self
323-
result.incrementalLoad = incrementalLoad
324-
return result
325-
}
326-
327316
/// The runLoopMode when animation is playing on. Defaults is `.common`
328317
/// You can specify a runloop mode to let it rendering.
329318
/// - Note: This is useful for some cases, for example, always specify NSDefaultRunLoopMode, if you want to pause the animation when user scroll (for Mac user, drag the mouse or touchpad)

0 commit comments

Comments
 (0)