You can get the orientation of a UIImage image using the imageOrientation method. For example, you want to save an image taken from a camera that you can take:
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; if (image) { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeImageToSavedPhotosAlbum:[image CGImage] orientation:[image imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){ }]; [library autorelease]; }
and then when you want to get the UIImage from the library, you can get the orientation by doing something like:
UIImage *image = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullResolutionImage] scale:1.0 orientation:[asset orientation]];
calampunay Jan 17 '11 at 10:00 p.m. 2011-01-17 22:00
source share