This line of code has no effect. It does not change orientation of the image. What am I doing wrong?
// image is of type UIImage
UIImage * newImage = [UIImage imageWithCGImage:[image CGImage] scale:image.scale orientation:UIImageOrientationLeft];
This line of code has no effect. It does not change orientation of the image. What am I doing wrong?
// image is of type UIImage
UIImage * newImage = [UIImage imageWithCGImage:[image CGImage] scale:image.scale orientation:UIImageOrientationLeft];
Refer to the definition of this method below, make sure your CGImage is of a CGImageRef class.
imageWithCGImage:[image CGImage]
+(UIImage *)imageWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation
Following three lines are some initializations before you call the method.
CIContext * context = [CIContext contextWithOptions:nil]; //your choice
CIImage * OriginalImage = [CIImage imageWithContentsOfURL:fileNameAndPath]; //your own choice of source image file.
CGImageRef CGImage = [context createCGImage:OriginalImage fromRect:(CGRect)];
UIImage *newImage = [UIImage imageWithCGImage:CGImage scale:1.0 orientation:UIImageOrientationLeft]
Hope this helps.