I use CGImageSourceCreateThumbnailAtIndex to resize and rotate a CGIImage. It works fine on ios 16 and below, but on ios 17, rotating does not work anymore.
CGImageSourceRef imageSource = CGImageSourceCreateWithData(capturedImage, nil);
CFDictionaryRef options = (__bridge CFDictionaryRef) @{
(id) kCGImageSourceCreateThumbnailWithTransform: @YES,
(id) kCGImageSourceCreateThumbnailFromImageAlways : @YES,
(id) kCGImageSourceThumbnailMaxPixelSize : @(maxPixelSize),
(id) kCGImagePropertyOrientation: @(rotationAngle)
};
CGImageRef thumbnail = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options);
CFRelease(imageSource);
return thumbnail;
}
I tried to set the rotationAngle to different constant kCGImagePropertyOrientationUp, kCGImagePropertyOrientationLeft, kCGImagePropertyOrientationDown, kCGImagePropertyOrientationRight but it all returns the same image.
Anyone experiencing the same issue and have an idea what has changed on ios 17 that breaks the API.
Noted: it still works fine on iPadOS 17, can only reproduce on iOS 17.