Programatically I have fetched image from my camera in my app. It has been fetched nicely but when I shift to another view and dismiss that view at that time my image automa
It is due to your image orientation. so keep original image orientation. you will get the image orientation in your UIImagePickerController delegate method
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
sample code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *sourceImage = [info valueForKey:UIImagePickerControllerOriginalImage];
NSData *data = UIImagePNGRepresentation(sourceImage);
UIImage *tmp = [UIImage imageWithData:data];
UIImage *afterFixingOrientation = [UIImage imageWithCGImage:tmp.CGImage
scale:sourceImage.scale
orientation:sourceImage.imageOrientation];
[self.imagePickerController dismissViewControllerAnimated:YES completion:nil];
}