In your delegate:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
After you get your UIImage
from "info" dictionary for the key "UIImagePickerControllerOriginalImage
" ,You can see the image orientation by imageOrientation property. If is not like you want just rotate your image before you upload it.
imageOrientation
The orientation of the receiver’s image. (read-only)
@property(nonatomic, readonly) UIImageOrientation imageOrientation
Discussion
Image orientation affects the way the image data is displayed when drawn. By default, images are displayed in the “up” orientation. If the image has associated metadata (such as EXIF information), however, this property contains the orientation indicated by that metadata. For a list of possible values for this property, see “UIImageOrientation.”
Availability
Available in iOS 2.0 and later.
Declared In
UIImage.h
UIImage Class Reference
UIImagePickerController Class Reference
UIImagePickerControllerDelegate Protocol Reference
Second option:
Is to allow user to edit your image and get the image for "UIImagePickerControllerEditedImage
";
Set your UIImagePickerController
"allowsEditing" property to Yes
.
In your delegate just get from the "info" dictionary the UIImage
for the "UIImagePickerControllerEditedImage
" key.
Good luck.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…