Merge pull request #3038 from dreampiggy/bugfix_embed_thumbnail_max_pixel_size
Change to use kCGImageSourceCreateThumbnailFromImageAlways to solve the issue when HEIC/JPEG contains an embed thumbnail but its size is much smaller than provided `maxPixelSize`
This commit is contained in:
commit
6f5f8354fa
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue