This is a little piece of code to that detects how an image from an iPhone is rotated. Useful for rotating them for software that lacks an auto-rotate feature or for handling web uploads.