Fix orientation of UIImage stored in a document with lost EXIF ​​tags

I ran into a similar problem for others regarding SO regarding UIImages orientation done using an iPad camera. In fact, I take UIImage using the camera on the iPad. When I show it, it rotates 90 degrees.

From reading other questions and answers, I now understand that when the camera takes pictures, it stores the EXIF ​​tag, which determines the orientation of the photo. This will usually allow all Mac and iOS applications to read orientation data. However, I save my images in the document directory as NSData (was converted via the UIImagePNGR representation and saved the URL in the main data. I assume that this process makes me lose the EXIF ​​orientation tag, so when it is retrieved it displays incorrectly.

Can anyone think of a way to fix this?

Thoughts, tips and pointers are welcome.

Many thanks

+3
source share
3 answers

EXIF ​​ , GPS-, 90 180 270 ,

iOS UIImagePickerController -

+2

EXIF ​​- , , UIImage. , UIImagePicker , EXIF.

, , iPad. , UIImagePNGR 90 ( ). PNG. , , .

+3

All Articles