Fix the issue the fallback logic of ImageIO Source should avoid passing any UTI hint

This commit is contained in:
DreamPiggy 2023-01-22 11:23:18 +08:00
parent 6c6b951845
commit a80af99d0a
2 changed files with 2 additions and 2 deletions

View File

@ -409,7 +409,7 @@ static CGImageRef __nullable SDCGImageCreateCopy(CGImageRef cg_nullable image) {
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)creatingOptions);
if (!source) {
// Try again without UTType hint, the call site from user may provide the wrong UTType
source = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)creatingOptions);
source = CGImageSourceCreateWithData((__bridge CFDataRef)data, nil);
}
if (!source) {
return nil;

View File

@ -202,7 +202,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)creatingOptions);
if (!source) {
// Try again without UTType hint, the call site from user may provide the wrong UTType
source = CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)creatingOptions);
source = CGImageSourceCreateWithData((__bridge CFDataRef)data, nil);
}
if (!source) {
return nil;