From 6a227343a6a771b94e807070c1e2e851e77926f5 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 12 Jun 2020 11:41:22 +0800 Subject: [PATCH] Change to use kCGImageSourceCreateThumbnailFromImageAlways to solve the issue when HEIC/JPEG contains an embed thumbnail but its size is much smaller than provided `maxPixelSize` --- SDWebImage/Core/SDImageIOAnimatedCoder.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/Core/SDImageIOAnimatedCoder.m b/SDWebImage/Core/SDImageIOAnimatedCoder.m index df6415c3..ab6f0172 100644 --- a/SDWebImage/Core/SDImageIOAnimatedCoder.m +++ b/SDWebImage/Core/SDImageIOAnimatedCoder.m @@ -215,7 +215,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination maxPixelSize = MAX(thumbnailSize.width, thumbnailSize.height); } decodingOptions[(__bridge NSString *)kCGImageSourceThumbnailMaxPixelSize] = @(maxPixelSize); - decodingOptions[(__bridge NSString *)kCGImageSourceCreateThumbnailFromImageIfAbsent] = @(YES); + decodingOptions[(__bridge NSString *)kCGImageSourceCreateThumbnailFromImageAlways] = @(YES); imageRef = CGImageSourceCreateThumbnailAtIndex(source, index, (__bridge CFDictionaryRef)decodingOptions); } if (!imageRef) {