I am having a problem when i crop the image. I am getting my image from documents folder. after cropping my image gets rotated counterclockwise in my uiimageview. please help. This is the method I use for cropping:
- (UIImage *)croppedImage:(CGRect)bounds {
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], bounds);
UIImage *croppedImage = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
return croppedImage;
}
This is the code I use to call the method:
CGRect cropRect = CGRectMake(0,0,imageview.size.width, imageview.size.height)
UIImage *croppedImage = [previewImage croppedImage:cropRect];
Does anyone know why does my image gets rotated?