You can do this on the client with HTML5. You should have an appropriate server based fallback for older browsers that don't support File and FileReader.
You can write your own exif parser or use the jsjpegmeta library(Ben Leslie), which is a simple+awesome library that lets the browser extract the EXIF data from most jpeg files. There is a patch that says it fixes most of the compatibility problems. I haven't tested the patch, but be prepared to fork the project and put on your github hat.
To get the EXIF:
- Open file dialog: I usually create a button that calls a function to generate the
<file
input and add a change handler
- Get the files: In the file change handler ue
$(this).get(0).files
to get the list of selected files.
- Parse the exif data: Send the browse results to jsjpegmeta
I had to tweak the library a bit to get it to do what I wanted (I wanted a commonJS library) I also made the tweak identified in issue 1.
Here is a fiddle
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…