I use jhead package (usually available as a precompiled package on linux); to extract the date in bash, you should do something like
DATE=`jhead $PHOTO.jpg`|grep '^Date/Time'`
DATE=${DATE#*:}
it does also many useful things like rotating the photo according to the orientation flag, adjusting the exif date and other.
An alternative is the 'identify' command from the ImageMagick package:
identify -format %[EXIF:DateTime] $PHOTO.jpg
identify -verbose $PHOTO.jpg shows all possible information that can be queried.
Main Topics
Browse All Topics





by: JIEXAPosted on 2009-08-31 at 00:18:39ID: 25220959
You need to install a tool that does the extraction. The simplest one is exiftool. For Linux, it's a Perl library.
.ca/~phil/ exiftool/
http://www.sno.phy.queensu