*Last updated: 2017-03-18* ## Searching for Files ### Find images in a directory that don't have a DateTimeOriginal ### exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' . ###Output photos that don't have datetimeoriginal to a CSV### *Note this can take a long time if you have a lot of jpgs* # You'll need to set your Dropbox folder path. I have mine set as a global variable OLDFILE="$DROPBOX_PERSONAL/nodates.csv" FILECOUNT=$(mdfind -count -onlyin "$DROPBOX_PERSONAL" 'kMDItemKind =="JPEG image"') while IFS= read -r -d '' n; do FILECOUNT=$(( $FILECOUNT - 1 )) if grep -q "$n" "$OLDFILE"; then echo "Skipping $n" continue fi echo -ne "Remaining: $FILECOUNT\r" exiftool -q -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00"))' -csv -common "$n" | sed 1d >> "$DROPBOX_PERSONAL/nodates.csv" done < <( mdfind -onlyin "$DROPBOX_PERSONAL" 'kMDItemKind =="JPEG image"' -0 ) ### See files File Modify Date recursively in a directory who don't have datetimeoriginal set ### exiftool -filemodifydate -r -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' . ## Modifying Files ### Create Captions From a Filename ### The command alone will put the *full* filename in the comments. If you want to add the filename without the extension, add the example exiftool config file found [here][config] # This is the command if you have the config installed exiftool '-Comment 300000' '-Directory 300000'` gets files that are over 300kB. I was parsing an iPhoto library where there were thumbnails. The `#` turns the value to a number. you can use the flag `-n` to turn all values to numbers `'-Directory out.kml exiftool -n -r -q -p $DESKTOP/kml-placemark.fmt . >> out.kml cat $DESKTOP/kml-end.fmt >> out.kml ### Create CSV of Geo Information ### exiftool -csv -filename -imagesize -gps:GPSLatitude -gps:GPSLongitude ./ > long.csv ## Update Notes ## - 2017-03-18 - added command to create comments from a filename - 2015-08-11 - added line to rename files based on milliseconds - 2015-01-18 - added line on how to set a date for a particular photo(s) - 2014-12-26 - Adding new recursive command to rename JPG to jpg. Info on using `sh` with `-exec` [here][exec_sh] - 2014-12-25 - Added line for copying photos into organized photos. [exec_sh]: http://unix.stackexchange.com/questions/60404/manipulate-file-name-piped-from-find-command [config]: http://www.sno.phy.queensu.ca/~phil/exiftool/config.html