Merge pull request #3473 from dreampiggy/bugfix/create_options

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:43:31 +08:00 committed by GitHub
commit 8a6dcf8882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;