#define radians(degrees) (degrees * M_PI/180)
UIImage *rotate(UIImage *image) {
CGSize size = image.size;;
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
// If this is commented out, image is returned as it is.
CGContextRotateCTM (context, radians(90));
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
Может ли что-то другое ошибиться? Из идей.