Merge pull request #3661 from dreampiggy/project/remove_assert_thumbnail_cache_key
Temp remove the assert when thumbnail cache key used with thumbnail context , this may be changed later
This commit is contained in:
commit
956e29ccb5
|
@ -323,6 +323,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
|
|||
* @param doneBlock The completion block. Will not get called if the operation is cancelled
|
||||
*
|
||||
* @return a SDImageCacheToken instance containing the cache operation, will callback immediately when cancelled
|
||||
* @warning If you query with thumbnail cache key, you'd better not pass the thumbnail pixel size context, which is undefined behavior.
|
||||
*/
|
||||
- (nullable SDImageCacheToken *)queryCacheOperationForKey:(nullable NSString *)key options:(SDImageCacheOptions)options done:(nullable SDImageCacheQueryCompletionBlock)doneBlock;
|
||||
|
||||
|
@ -335,6 +336,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
|
|||
* @param doneBlock The completion block. Will not get called if the operation is cancelled
|
||||
*
|
||||
* @return a SDImageCacheToken instance containing the cache operation, will callback immediately when cancellederation, will callback immediately when cancelled
|
||||
* @warning If you query with thumbnail cache key, you'd better not pass the thumbnail pixel size context, which is undefined behavior.
|
||||
*/
|
||||
- (nullable SDImageCacheToken *)queryCacheOperationForKey:(nullable NSString *)key options:(SDImageCacheOptions)options context:(nullable SDWebImageContext *)context done:(nullable SDImageCacheQueryCompletionBlock)doneBlock;
|
||||
|
||||
|
@ -348,6 +350,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
|
|||
* @param doneBlock The completion block. Will not get called if the operation is cancelled
|
||||
*
|
||||
* @return a SDImageCacheToken instance containing the cache operation, will callback immediately when cancelled
|
||||
* @warning If you query with thumbnail cache key, you'd better not pass the thumbnail pixel size context, which is undefined behavior.
|
||||
*/
|
||||
- (nullable SDImageCacheToken *)queryCacheOperationForKey:(nullable NSString *)key options:(SDImageCacheOptions)options context:(nullable SDWebImageContext *)context cacheType:(SDImageCacheType)queryCacheType done:(nullable SDImageCacheQueryCompletionBlock)doneBlock;
|
||||
|
||||
|
|
|
@ -533,8 +533,7 @@ static NSString * _defaultDiskCacheDirectory;
|
|||
// The disk -> memory sync logic, which should only store thumbnail image with thumbnail key
|
||||
// However, caller (like SDWebImageManager) will query full key, with thumbnail size, and get thubmnail image
|
||||
// We should add a check here, currently it's a hack
|
||||
if (diskImage.sd_isThumbnail) {
|
||||
NSAssert(!SDIsThumbnailKey(key), @"The input cache key %@ should not be thumbnail key", key);
|
||||
if (diskImage.sd_isThumbnail && !SDIsThumbnailKey(key)) {
|
||||
SDImageCoderOptions *options = diskImage.sd_decodeOptions;
|
||||
CGSize thumbnailSize = CGSizeZero;
|
||||
NSValue *thumbnailSizeValue = options[SDImageCoderDecodeThumbnailPixelSize];
|
||||
|
|
Loading…
Reference in New Issue