SDWebImage加载超高清大图 显示不出来问题处理

 NSURL *url = [NSURL URLWithString:  [photo.largeImageURL.absoluteString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]];
 
                [_imageView sd_setImageWithURL:url placeholderImage:photo.thumbImage options:SDWebImageRetryFailed|SDWebImageScaleDownLargeImages|SDWebImageRefreshCached progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
    
    
                    dispatch_async(dispatch_get_main_queue(), ^{
    
    
                        CGFloat progress = (CGFloat)receivedSize / (CGFloat)expectedSize;
                        if (photo.progressUpdateBlock) {
    
    
                            photo.progressUpdateBlock(photo, progress);
                        }
                    });
                } completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
    
    
                    dispatch_async(dispatch_get_main_queue(), ^{
    
    
                        if (image) {
    
    
                            // Successful load
                            if ([self.photo.largeImageURL.absoluteString isEqualToString:imageURL.absoluteString]) {
    
    
                                [self hideProgressView];
                                self.photo.originalImage = image;
                                [self resizeSubviewsSize];
                            }
                        } else {
    
    
                            // Failed to load
                            [self hideProgressView];
                        }
                    });
                }];

猜你喜欢

转载自blog.csdn.net/weixin_42050662/article/details/131695508