...
|
...
|
@@ -308,14 +308,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
|
|
|
|
|
- (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key {
|
|
|
NSString *defaultPath = [self defaultCachePathForKey:key];
|
|
|
NSData *data = [NSData dataWithContentsOfFile:defaultPath];
|
|
|
NSData *data = [NSData dataWithContentsOfFile:defaultPath options:self.config.diskCacheReadingOptions error:nil];
|
|
|
if (data) {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
|
|
// checking the key with and without the extension
|
|
|
data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension];
|
|
|
data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil];
|
|
|
if (data) {
|
|
|
return data;
|
|
|
}
|
...
|
...
|
@@ -323,14 +323,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
|
|
NSArray<NSString *> *customPaths = [self.customPaths copy];
|
|
|
for (NSString *path in customPaths) {
|
|
|
NSString *filePath = [self cachePathForKey:key inPath:path];
|
|
|
NSData *imageData = [NSData dataWithContentsOfFile:filePath];
|
|
|
NSData *imageData = [NSData dataWithContentsOfFile:filePath options:self.config.diskCacheReadingOptions error:nil];
|
|
|
if (imageData) {
|
|
|
return imageData;
|
|
|
}
|
|
|
|
|
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
|
|
// checking the key with and without the extension
|
|
|
imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension];
|
|
|
imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil];
|
|
|
if (imageData) {
|
|
|
return imageData;
|
|
|
}
|
...
|
...
|
|