Skip to content

Commit b6f4692

Browse files
committed
Supports the UIImageView to show Prorgessive Animated Image's first poster frame, match the behavior of built-in coders
1 parent 602184e commit b6f4692

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SDWebImageWebPCoder/Classes/SDImageWebPCoder.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ - (void)updateIncrementalData:(NSData *)data finished:(BOOL)finished {
347347
- (UIImage *)incrementalDecodedImageWithOptions:(SDImageCoderOptions *)options {
348348
UIImage *image;
349349

350+
// For Animated WebP Images, progressive decoding only return the first frame.
351+
// If you want progressive animation, use the SDAniamtedCoder protocol method instead.
352+
if (_demux) {
353+
SD_LOCK(_lock);
354+
image = [self safeStaticImageFrame];
355+
SD_UNLOCK(_lock);
356+
}
357+
// For Static WebP images
350358
int width = 0;
351359
int height = 0;
352360
int last_y = 0;

0 commit comments

Comments
 (0)