Skip to content

Commit 0326c3e

Browse files
committed
fix: Loading images by reverting "bug: Use device scale when loading images.".
fix #509 This reverts commit 5cb5d6b.
1 parent ba958f2 commit 0326c3e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

ios/FastImage/FFFastImageView.m

+3-10
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ - (void)setImageColor:(UIColor *)imageColor {
6969

7070
- (UIImage*)makeImage:(UIImage *)image withTint:(UIColor *)color {
7171
UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
72-
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0.0);
72+
UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
7373
[color set];
74-
[newImage drawInRect:CGRectMake(0, 0, newImage.size.width, newImage.size.height)];
74+
[newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
7575
newImage = UIGraphicsGetImageFromCurrentImageContext();
7676
UIGraphicsEndImageContext();
7777
return newImage;
@@ -124,7 +124,7 @@ - (void)reloadImage
124124
} {
125125
self.hasSentOnLoadStart = NO;
126126
}
127-
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url] scale:[[UIScreen mainScreen] scale]];
127+
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url]];
128128
[self setImage:image];
129129
if (self.onFastImageProgress) {
130130
self.onFastImageProgress(@{
@@ -209,13 +209,6 @@ - (void)downloadImage:(FFFastImageSource *) source options:(SDWebImageOptions) o
209209
weakSelf.onFastImageLoadEnd(@{});
210210
}
211211
} else {
212-
CGFloat scale = [UIScreen mainScreen].scale;
213-
214-
if (scale > 1.0) {
215-
image = [UIImage imageWithCGImage:[image CGImage] scale: scale orientation:UIImageOrientationUp];
216-
[weakSelf setImage:image];
217-
}
218-
219212
weakSelf.hasCompleted = YES;
220213
[weakSelf sendOnLoad:image];
221214
if (weakSelf.onFastImageLoadEnd) {

0 commit comments

Comments
 (0)