ExifTool Forum

ExifTool => Newbies => Topic started by: remco on February 18, 2023, 07:11:46 AM

Title: Use file details if EXIF data does not exists
Post by: remco on February 18, 2023, 07:11:46 AM
Is it possible to organize (thus move a file to a destination) based on the file property date in case the photo does not contain any EXIF data?
Title: Re: Use file details if EXIF data does not exists
Post by: Phil Harvey on February 18, 2023, 07:49:58 AM
Yes.  Run "exiftool -G1 -s FILE" on a file to see what information is available.  Any extracted information may be to rename and/or move the file.  The available filesystem properties are shown in the System group.  If you are on MacOS, add -API requestall=2 to also get the MacOS system properties.

- Phil
Title: Re: Use file details if EXIF data does not exists
Post by: StarGeek on February 18, 2023, 11:18:08 AM
This example (https://exiftool.org/filename.html#ex12) shows how you can rename based upon several tags, depending upon what data exists in the file.  It is based upon Note #1 under the -TAG[+-^]=[VALUE] option (https://exiftool.org/exiftool_pod.html#TAG---VALUE).
     Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence

So you could try to rename upon a tag such as DateTimeOriginal and then fall back on FileModifyDate if the DateTimeOriginal doesn't exist.
exiftool -d "%Y-%m-%d_%H.%M.%S%%+c.%%e" "-Filename<FileModifyDate" "-Filename<DateTimeOriginal" /path/to/files/