i am using UIImagePicker to get an image from the library. I just want to hide panorama library. Is there any option for hide this library in UIImagePicker.Thanks in advance.
Asked
Active
Viewed 2,058 times
2
-
why not you check the width of pics – IQworld Master Jun 05 '14 at 07:42
-
but kindly tell me what is maximum or minimum width and height of panorama pic. – Ali Raza Jun 05 '14 at 07:47
-
if you are taking form the device then it will be just greater then the screen resolution .and if it is equal or small then it will be not . hope you understand – IQworld Master Jun 05 '14 at 07:49
-
yes got it but when we get from web or gallery then how we identify. – Ali Raza Jun 05 '14 at 07:51
-
But this can't check if it is a web image downloaded from elsewhere. – IQworld Master Jun 05 '14 at 07:55
-
This may help you http://stackoverflow.com/questions/21744404/how-to-check-a-image-selected-is-panorama-image-or-not – IQworld Master Jun 05 '14 at 07:56
1 Answers
1
A panorama is just a picture with a large ratio between width and height (or vice versa).
There is no minimum or maximum (OK, there might be a maximum) size.
The ratio of a standard photo is around 4:3
(from the iPhone camera) so you could find the ratio and determine whether or not it is a panorama.
Something like...
CGFloat smallest = MIN(image.size.width, image.size.height);
CGFloat largest = MAX(image.size.width, image.size.height);
CGFloat ratio = largest/smallest;
CGFloat maximumRatioForNonePanorama = 4 / 3; // set this yourself depending on
if (ratio > maximumRatioForNonePanorama) {
// it is probably a panorama
}
However, also note that when taking a panorama you can start it a stop it without moving the camera at all so it will just be a standard photo.
This is why you have to use the ratio like this. There isn't a flag you can rely on (I think).

Fogmeister
- 76,236
- 42
- 207
- 306