Fix the logic in SDAnimatedImage to detect scale from file path. Should not limit any path length
This commit is contained in:
parent
f45c0441fd
commit
4f10e79f05
|
@ -25,9 +25,7 @@ static CGFloat SDImageScaleFromPath(NSString *string) {
|
|||
|
||||
NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines error:nil];
|
||||
[pattern enumerateMatchesInString:name options:kNilOptions range:NSMakeRange(0, name.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
|
||||
if (result.range.location >= 3) {
|
||||
scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue;
|
||||
}
|
||||
scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue;
|
||||
}];
|
||||
|
||||
return scale;
|
||||
|
|
Loading…
Reference in New Issue