UIImagePickerController - wrong orientation

If I select an image using UIImagePickerController, sometimes what I get back is in the wrong orientation.

In 2021 this was asked, and the response was

[Greg O’Lone]
it’s not actually. the problem is that the image is stored with a rotation attribute that you cannot access. We’ve already got a feature request to make that information available.

Did anyone work out how to get the attribute in the last 3 years?

Not the answer you’re looking for, but I added a Rotate button for the retrieved Picture.

1 Like

Hi @Jeff_Tullin

I remember adding a fix for MobileImagePicker some releases ago (don’t have the issue # at hand right now)… so it does exactly what you want. I don’t know if that would work for the purposes of your app. :thinking:

@Javier_Menendez
The MobileImagePicker does show pictures from the Photos library, in the right orientation.
But the returned image is cropped… it can lose the top/bottom or sides. That’s not usable.
The move/scale options are displayed but do not work.

It cannot see images in the files folder.

It is mobileimagepicker I want to replace using these other options because it doesnt work very well.

Interesting… what I’m seeing here is just the oposite, the iOS UI for the native ImagePicker displays the thumbnails cropped mostly for those images in (original) vertical orientation… but the returned image has both the right orientation and the full size, not cropped :man_shrugging:

Its the unavoidable cropping that has brought me here. It’s not every image that gets cropped.
It may have something to do with the other effect I have seen.

Using the UIImagePicker on (for example) , an image which is 800 wide and 1200 tall , I can tell what the width and height are.
But if the image contains rotation data, the image I get doesnt match the dimensions.
By which I mean I may read a width of 800 and height of 1200, but I actually receive an image that is 1200 wide and 800 tall because it is rotated.
I cant tell it has been rotated, and if I display it in a shape of 800x 1200, it looks ridiculous
image

It feels to me that the MobileImagePicker may automatically correct the orientation, but return something of the shape of the unrotated image.
And as I say, it offers Move/Scale but ignores any attempt to do those actions.

maybe in some drawing ? I remeber having issues with g.DrawPicture on ios if that’s how you see the content ?