Revert changes for FLAnimatedImage performance enhancement.
Keep the refactored code for future maintain
This commit is contained in:
parent
5872bd660b
commit
7b649a8bbf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue