Revert changes for FLAnimatedImage performance enhancement.

Keep the refactored code for future maintain
This commit is contained in:
DreamPiggy 2017-11-16 18:32:45 +08:00
parent 5872bd660b
commit 7b649a8bbf
1 changed files with 6 additions and 14 deletions

View File

@ -52,25 +52,17 @@
options:options
operationKey:nil
setImageBlock:^(UIImage *image, NSData *imageData) {
// This setImageBlock may not called from main queue
SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData];
FLAnimatedImage *animatedImage;
if (imageFormat == SDImageFormatGIF) {
animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
weakSelf.animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
weakSelf.image = nil;
} else {
weakSelf.image = image;
weakSelf.animatedImage = nil;
}
dispatch_main_async_safe(^{
if (animatedImage) {
weakSelf.animatedImage = animatedImage;
weakSelf.image = nil;
} else {
weakSelf.image = image;
weakSelf.animatedImage = nil;
}
});
}
progress:progressBlock
completed:completedBlock
context:@{SDWebImageInternalSetImageInGlobalQueueKey: @(YES)}];
completed:completedBlock];
}
@end