I was watching Castle the other night and he took his iPhone, held it upside down, against the door sill and snapped a pic of the perp. When he held the phone right side up and viewed the pic, it was right side up.

I thought Foul! Cameras don't work that way, but indeed the iPhone's camera knows, courtesy of it's rotation sensor, which side of the pic is up, and rotates and displays the pic right side up.
_________________________
Glenn