@@ -79,20 +79,6 @@ @implementation YYCache (SDAdditions)
79
79
}
80
80
81
81
- (id <SDWebImageOperation>)queryImageForKey : (NSString *)key options : (SDWebImageOptions)options context : (SDWebImageContext *)context cacheType : (SDImageCacheType)queryCacheType completion : (SDImageCacheQueryCompletionBlock)doneBlock {
82
- SDImageCacheOptions cacheOptions = 0 ;
83
- if (options & SDWebImageQueryMemoryData) cacheOptions |= SDImageCacheQueryMemoryData;
84
- if (options & SDWebImageQueryMemoryDataSync) cacheOptions |= SDImageCacheQueryMemoryDataSync;
85
- if (options & SDWebImageQueryDiskDataSync) cacheOptions |= SDImageCacheQueryDiskDataSync;
86
- if (options & SDWebImageScaleDownLargeImages) cacheOptions |= SDImageCacheScaleDownLargeImages;
87
- if (options & SDWebImageAvoidDecodeImage) cacheOptions |= SDImageCacheAvoidDecodeImage;
88
- if (options & SDWebImageDecodeFirstFrameOnly) cacheOptions |= SDImageCacheDecodeFirstFrameOnly;
89
- if (options & SDWebImagePreloadAllFrames) cacheOptions |= SDImageCachePreloadAllFrames;
90
- if (options & SDWebImageMatchAnimatedImageClass) cacheOptions |= SDImageCacheMatchAnimatedImageClass;
91
-
92
- return [self queryCacheOperationForKey: key options: cacheOptions context: context cacheType: queryCacheType done: doneBlock];
93
- }
94
-
95
- - (id <SDWebImageOperation>)queryCacheOperationForKey : (nullable NSString *)key options : (SDImageCacheOptions)options context : (nullable SDWebImageContext *)context cacheType : (SDImageCacheType)queryCacheType done : (nullable SDImageCacheQueryCompletionBlock)doneBlock {
96
82
if (!key) {
97
83
if (doneBlock) {
98
84
doneBlock (nil , nil , SDImageCacheTypeNone);
@@ -114,7 +100,7 @@ @implementation YYCache (SDAdditions)
114
100
}
115
101
116
102
if (image) {
117
- if (options & SDImageCacheDecodeFirstFrameOnly ) {
103
+ if (options & SDWebImageDecodeFirstFrameOnly ) {
118
104
// Ensure static image
119
105
if (image.sd_isAnimated ) {
120
106
#if SD_MAC
@@ -123,7 +109,7 @@ @implementation YYCache (SDAdditions)
123
109
image = [[UIImage alloc ] initWithCGImage: image.CGImage scale: image.scale orientation: image.imageOrientation];
124
110
#endif
125
111
}
126
- } else if (options & SDImageCacheMatchAnimatedImageClass ) {
112
+ } else if (options & SDWebImageMatchAnimatedImageClass ) {
127
113
// Check image class matching
128
114
Class animatedImageClass = image.class ;
129
115
Class desiredImageClass = context[SDWebImageContextAnimatedImageClass];
@@ -133,7 +119,7 @@ @implementation YYCache (SDAdditions)
133
119
}
134
120
}
135
121
136
- BOOL shouldQueryMemoryOnly = (queryCacheType == SDImageCacheTypeMemory) || (image && !(options & SDImageCacheQueryMemoryData ));
122
+ BOOL shouldQueryMemoryOnly = (queryCacheType == SDImageCacheTypeMemory) || (image && !(options & SDWebImageQueryMemoryData ));
137
123
if (shouldQueryMemoryOnly) {
138
124
if (doneBlock) {
139
125
doneBlock (image, nil , SDImageCacheTypeMemory);
@@ -147,8 +133,8 @@ @implementation YYCache (SDAdditions)
147
133
// Check whether we need to synchronously query disk
148
134
// 1. in-memory cache hit & memoryDataSync
149
135
// 2. in-memory cache miss & diskDataSync
150
- BOOL shouldQueryDiskSync = ((image && options & SDImageCacheQueryMemoryDataSync ) ||
151
- (!image && options & SDImageCacheQueryDiskDataSync ));
136
+ BOOL shouldQueryDiskSync = ((image && options & SDWebImageQueryMemoryDataSync ) ||
137
+ (!image && options & SDWebImageQueryDiskDataSync ));
152
138
NSData * (^queryDiskDataBlock)(void ) = ^NSData * {
153
139
@synchronized (operation) {
154
140
if (operation.isCancelled ) {
0 commit comments