|
@@ -308,14 +308,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
|
@@ -308,14 +308,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
308
|
|
308
|
|
309
|
- (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key {
|
309
|
- (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key {
|
310
|
NSString *defaultPath = [self defaultCachePathForKey:key];
|
310
|
NSString *defaultPath = [self defaultCachePathForKey:key];
|
311
|
- NSData *data = [NSData dataWithContentsOfFile:defaultPath];
|
311
|
+ NSData *data = [NSData dataWithContentsOfFile:defaultPath options:self.config.diskCacheReadingOptions error:nil];
|
312
|
if (data) {
|
312
|
if (data) {
|
313
|
return data;
|
313
|
return data;
|
314
|
}
|
314
|
}
|
315
|
|
315
|
|
316
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
316
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
317
|
// checking the key with and without the extension
|
317
|
// checking the key with and without the extension
|
318
|
- data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension];
|
318
|
+ data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil];
|
319
|
if (data) {
|
319
|
if (data) {
|
320
|
return data;
|
320
|
return data;
|
321
|
}
|
321
|
}
|
|
@@ -323,14 +323,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
|
@@ -323,14 +323,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { |
323
|
NSArray<NSString *> *customPaths = [self.customPaths copy];
|
323
|
NSArray<NSString *> *customPaths = [self.customPaths copy];
|
324
|
for (NSString *path in customPaths) {
|
324
|
for (NSString *path in customPaths) {
|
325
|
NSString *filePath = [self cachePathForKey:key inPath:path];
|
325
|
NSString *filePath = [self cachePathForKey:key inPath:path];
|
326
|
- NSData *imageData = [NSData dataWithContentsOfFile:filePath];
|
326
|
+ NSData *imageData = [NSData dataWithContentsOfFile:filePath options:self.config.diskCacheReadingOptions error:nil];
|
327
|
if (imageData) {
|
327
|
if (imageData) {
|
328
|
return imageData;
|
328
|
return imageData;
|
329
|
}
|
329
|
}
|
330
|
|
330
|
|
331
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
331
|
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
|
332
|
// checking the key with and without the extension
|
332
|
// checking the key with and without the extension
|
333
|
- imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension];
|
333
|
+ imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil];
|
334
|
if (imageData) {
|
334
|
if (imageData) {
|
335
|
return imageData;
|
335
|
return imageData;
|
336
|
}
|
336
|
}
|