I want to send an image to a saas via an http post request.
That image is taken by the iPhone camera or choosen from the iPhone library.
The problem is that iPhone seems to encode the orientation of the image in the exif data, so when I try to send the image via POST the service elaborate it with the wrong orientation (it isn’t so smart to check exif tag first).
Can someone post a snippet that check the exif (if any) and make a new image with correct Orientation?
Thank you for any help.
At the risk of encouraging copy-paste programming, I’ll say that I use the code found here to do the very same thing. It’ll take a UIImage, check the EXIF data, and return you a new UIImage that has been adjusted to match so your service won’t need to worry about it.
Just keep in mind you may need to tweak it slightly to match your specific needs. It’s definitely a starting point though.