EXIF

|

exiftool

brew install exiftool

mediainfo

brew install media-info

exiftool update filemodifieddate based on exif data

exiftool * '-filemodifydate<createdate' -if '($createdate and (not $createdate eq "0000:00:00 00:00:00"))'
#exiftool * '-filemodifydate<creationdate' -if '($creationdate and (not $creationdate eq "0000:00:00 00:00:00"))'
exiftool * '-filemodifydate<datetimeoriginal' -if '($datetimeoriginal and (not $datetimeoriginal eq "0000:00:00 00:00:00"))'
exiftool * '-filemodifydate<mediacreatedate' -if '($mediacreatedate and (not $mediacreatedate eq "0000:00:00 00:00:00"))'

exiftool: move based on date from exif data

exiftool -d %Y "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" .

Move image files from the current directory (.) into a directory hierarchy based on year/month. In this command the Directory tag is set from multiple other date/time tags. ExifTool evaluates the command-line arguments left to right, and latter assignments to the same tag override earlier ones, so the Directory for each image is ultimately set by the rightmost copy argument that is valid for that image. Specifically, Directory is set from DateTimeOriginal if it exists, otherwise CreateDate if it exists, and finally FileModifyDate (which always exists) is used as a fallback. source

copy exif data from one file to another

exiftool -tagsFromFile SRC DST

prefix file with date

exiftool '-filename<filemodifydate' '-filename<createdate' '-filename<datetimeoriginal' -d "%Y-%m-%d-%%f.%%e" *