
$ exiftool -p '$filename' -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"'.
To find all images (in JPEG) without any date run the following, recursively: $ cd photos
The first mistake when editing batch EXIF metadata is assuming that all images have EXIF metadata.
progress provides a countdown and transfer statistics during the copyĪssuming all your photos are in one place, to remove all white spaces recursively, run the following: detox -r -v photos/. E copies extended attributes and resource forks (OS X only). a applies archive settings to mirror the source files exactly, including. To make a backup of your photo folder run: rsync -vaE -progress photos photos_backup Instead of using cp, it's better to use a tool that is faster and copes better with file permissions. This will come handy for scripting because you don't have to escape white spaces in your files. It will also clean up filenames with UTF-8 or Latin-1 (or CP-1252) characters in them (i.e: foo bar - quz.avi -> foo_bar-quz.avi). It replaces difficult to work with characters, such as spaces, with standard equivalents. On macOS you can easily install it with: $ brew install exiftoolĭetox is a utility designed to clean up filenames. One final reminder, all the commands are only used on macOS, it might be different based on what OS you use.Įxiftool is a command line tool that allows you to change and manipulate the EXIF metadata of images. Always do a backup before you start working manipulating the data. During this time, I've gathered a set of small, short code pieces that allows me to change anything on a set of photos.īefore we dive in, please be cautious with the commands, some of them are disastrous. Some had EXIF metadata but were incorrectly named, some didn't have EXIF metadata, but I knew the time they were taken and most of them had filenames with random numbers based on the cameraīecause I didn't like the state of all my photos, I've decided to fix them. Not all of my photos had proper EXIF data. However, this was not the case couple of years ago. I have thousands of photos in a perfect, organized state with correct EXIF metadata. What if your photos don't contain a correct EXIF metadata? Let me show how to batch fix and manipulate photos easily on Terminal Tips & tricks to batch edit EXIF metadata of photosĮXIF metadata contains useful information about the photo.