How to know the Mode of the photo taken from Photo Library. eg- i am saving photo from the photo library into the application but how can i know that photo in Landscape mode or portrait mode. My photo get Stretch when it is in Landscape mode.
A:
When working with a landscape photo, the photo width is greater than the photo height. When working with a portrait photo, the height is greater than the width.
So, to check this on the iPhone after grabbing an image from the Photo Library, you would do something like this:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
[self dismissModalViewControllerAnimated:YES];
[picker release];
if(image.size.width > image.size.height){
//Landscape image
}
else if(image.size.height > image.size.width){
//Portrait image
}
}
Mark Hammonds
2009-11-18 05:19:30
Thank You Mark..
mactalent
2009-11-18 10:42:34