1. A non-transitory program storage device, readable by a programmable control device comprising instructions stored thereon for causing the programmable control device to: obtain image data from a first image captured by an image sensor of a device; detect text in the first image by analyzing the image data; determine one or more statistics for the detected text, wherein at least one of the one or more determined statistics is rotationally invariant; determine an orientation of the first image based on the determined one or more statistics; and store the orientation of the first image as metadata with the first image.