I'd like to rotate photos based on their original rotation, as set by the camera in JPEG EXIF image data. The trick is that all this should happen in the browser, using JavaScript and <canvas>. How could JavaScript access JPEG, a local file API object, local <img> or remote <img>, EXIF data to read the rotation information? Server-side answers are not OK; I am looking for a client-side solution.