Supports the UIImageView to show Prorgessive Animated Image's first poster frame, match the behavior of built-in coders

This commit is contained in:
DreamPiggy 2020-01-18 18:43:56 +08:00
parent 602184ee66
commit b6f4692439
1 changed files with 8 additions and 0 deletions

View File

@ -347,6 +347,14 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio
- (UIImage *)incrementalDecodedImageWithOptions:(SDImageCoderOptions *)options { - (UIImage *)incrementalDecodedImageWithOptions:(SDImageCoderOptions *)options {
UIImage *image; UIImage *image;
// For Animated WebP Images, progressive decoding only return the first frame.
// If you want progressive animation, use the SDAniamtedCoder protocol method instead.
if (_demux) {
SD_LOCK(_lock);
image = [self safeStaticImageFrame];
SD_UNLOCK(_lock);
}
// For Static WebP images
int width = 0; int width = 0;
int height = 0; int height = 0;
int last_y = 0; int last_y = 0;