How to check, the image selected from UIImagePickerController
is a Panorama Image or not?
In this UIImagePickerController
delegate method (be sure to add delegate methods to your View Controller class):
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self dismissViewControllerAnimated:YES completion:NULL];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
// determine if it's panorama by checking its dimension
CGFloat imageWidth = image.size.width;
CGFloat imageHeight = image.size.height;
// display the image if needed
[self.imageView setImage:image];
self.imagePickerController = nil;
}
Theoretically panorama images have much longer width than normal image. But this can't check if it is a web image downloaded from elsewhere.