Skip to content

Commit

Permalink
Merge pull request SDWebImage#1158 from akmarinov/master
Browse files Browse the repository at this point in the history
Fixed an issue that causes URLs with trailing parameters to be assign…
  • Loading branch information
bpoplauschi committed Jun 24, 2015
2 parents 466e401 + 8f309e1 commit 7e160e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions SDWebImage/SDWebImageCompat.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
CGFloat scale = 1.0;
if (key.length >= 8) {
// Search @2x. or @3x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x./@3x. + 4 len ext)
NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)];
NSRange range = [key rangeOfString:@"@2x."];
if (range.location != NSNotFound) {
scale = 2.0;
}

range = [key rangeOfString:@"@3x." options:0 range:NSMakeRange(key.length - 8, 5)];
range = [key rangeOfString:@"@3x."];
if (range.location != NSNotFound) {
scale = 3.0;
}
Expand Down

0 comments on commit 7e160e3

Please sign in to comment.