From 279f636ac561ff5bcf3eb4c9539fa93115980976 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Mon, 31 Oct 2022 23:41:46 +0800 Subject: [PATCH] Minor check the logic that UTI has high priority than path extension --- SDWebImage/Core/SDImageCacheDefine.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SDWebImage/Core/SDImageCacheDefine.m b/SDWebImage/Core/SDImageCacheDefine.m index 1182eefa..7278c6d6 100644 --- a/SDWebImage/Core/SDImageCacheDefine.m +++ b/SDWebImage/Core/SDImageCacheDefine.m @@ -31,7 +31,11 @@ SDImageCoderOptions * _Nonnull SDGetDecodeOptionsFromContext(SDWebImageContext * thumbnailSizeValue = context[SDWebImageContextImageThumbnailPixelSize]; } NSString *typeIdentifierHint = context[SDWebImageContextImageTypeIdentifierHint]; - NSString *fileExtensionHint = cacheKey.pathExtension; // without dot + NSString *fileExtensionHint; + if (!typeIdentifierHint) { + // UTI has high priority + fileExtensionHint = cacheKey.pathExtension; // without dot + } // First check if user provided decode options SDImageCoderMutableOptions *mutableCoderOptions;