ios - UIImage imageOrientation always reads opposite of way a picture is actually taken -


i encountering strange issue image.imageorientation appear opposite of way picture taken. example, when hold iphone 5 upright take picture, resulting image.imageorientation says "landscape", , verse versa.

here code taking picture, , checking image's orientation:

if ([mediatype isequaltostring:(nsstring *)kuttypeimage]){         //a photo taken         self.imagetakenorselected = [info objectforkey:uiimagepickercontrolleroriginalimage];                 if (self.imagetakenorselected.imageorientation == uiimageorientationup) {             nslog(@"!------portrait");         } else if (self.imagetakenorselected.imageorientation == uiimageorientationleft || self.imagetakenorselected.imageorientation == uiimageorientationright) {             nslog(@"!------landscape");         }          nslog(@"self.imagetaken width: %f, , height %f", self.imagetakenorselected.size.width, self.imagetakenorselected.size.height);     } 

for example, when take picture upright, nslog says "landscape", , read out of self.imagetaken width: 2448.000000, , height 3264.000000 seem suggest image is taken in portrait. going on here?

thanks!


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -