Skip to content

Commit

Permalink
Fixed an issue that causes URLs with trailing parameters to be assign…
Browse files Browse the repository at this point in the history
…ed an incorrect image scale value
  • Loading branch information
akmarinov committed May 25, 2015
1 parent 91b4251 commit 8f309e1
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 8f309e1

Please sign in to comment.