Skip to content

Commit

Permalink
fix: Loading images by reverting "bug: Use device scale when loading …
Browse files Browse the repository at this point in the history
…images.".

fix #509

This reverts commit 5cb5d6b.
  • Loading branch information
DylanVann committed Jul 3, 2019
1 parent ba958f2 commit 0326c3e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions ios/FastImage/FFFastImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ - (void)setImageColor:(UIColor *)imageColor {

- (UIImage*)makeImage:(UIImage *)image withTint:(UIColor *)color {
UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0.0);
UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
[color set];
[newImage drawInRect:CGRectMake(0, 0, newImage.size.width, newImage.size.height)];
[newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
Expand Down Expand Up @@ -124,7 +124,7 @@ - (void)reloadImage
} {
self.hasSentOnLoadStart = NO;
}
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url] scale:[[UIScreen mainScreen] scale]];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url]];
[self setImage:image];
if (self.onFastImageProgress) {
self.onFastImageProgress(@{
Expand Down Expand Up @@ -209,13 +209,6 @@ - (void)downloadImage:(FFFastImageSource *) source options:(SDWebImageOptions) o
weakSelf.onFastImageLoadEnd(@{});
}
} else {
CGFloat scale = [UIScreen mainScreen].scale;

if (scale > 1.0) {
image = [UIImage imageWithCGImage:[image CGImage] scale: scale orientation:UIImageOrientationUp];
[weakSelf setImage:image];
}

weakSelf.hasCompleted = YES;
[weakSelf sendOnLoad:image];
if (weakSelf.onFastImageLoadEnd) {
Expand Down

0 comments on commit 0326c3e

Please sign in to comment.