Skip to content

Commit

Permalink
Merge pull request kean#91 from HamzaGhazouani/master
Browse files Browse the repository at this point in the history
Fix bug for incomplete image downloads in low connection conditions
  • Loading branch information
kean committed Jan 12, 2016
2 parents ea0d749 + e0bf193 commit 0e6e579
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Pod/Source/Core/Private/DFImageManagerLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,15 @@ - (void)_loadOperation:(nonnull _DFImageLoadOperation *)operation didDecodeParti
}

- (void)_loadOperation:(nonnull _DFImageLoadOperation *)operation didCompleteWithData:(nullable NSData *)data info:(nullable NSDictionary *)info error:(nullable NSError *)error {
if (data.length) {
if (error || !data.length) {
[self _loadOperation:operation didCompleteWithImage:nil info:info error:error];
}
else {
typeof(self) __weak weakSelf = self;
[_decodingQueue addOperationWithBlock:^{
UIImage *image = [weakSelf.conf.decoder imageWithData:data partial:NO];
[weakSelf _loadOperation:operation didCompleteWithImage:image info:info error:error];
}];
} else {
[self _loadOperation:operation didCompleteWithImage:nil info:info error:error];
}
}

Expand Down

0 comments on commit 0e6e579

Please sign in to comment.