Merge pull request #1158 from akmarinov/master

Fixed an issue that causes URLs with trailing parameters to be assign…
This commit is contained in:
Bogdan Poplauschi 2015-06-25 01:33:39 +03:00
commit 7e160e34a2
1 changed files with 2 additions and 3 deletions

View File

@ -30,13 +30,12 @@ inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) {
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;
}