Quote from: wesley on April 21, 2020, 04:42:50 PM
Q: Will it keep XMP files with the Orginal? I have read the XMP Page,
No, exiftool only operates on one file at a time and doesn't match one file to another.
The basic idea is to use the
-TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) in combination with the
-FileOrder option (https://exiftool.org/exiftool_pod.html#fileOrder-NUM---TAG) to make sure one file is processed before the other.
To rename based upon the data in the XMP file, you would do something like
exiftool -fileorder Filename -TagsFromFile %d%f.xmp "-FileName<DateCreated" "-FileName<CreateDate" -d "/mnt/user/Photography-Archive/exifdata/%Y/%m/%d/%Y-%m-%d-%H-%M-%S-0%%c.%%le" <FileOrDir>To do the reverse, you would need to specify the RAW extension. Here's an example using NEF
exiftool -fileorder -Filename -TagsFromFile %d%f.NEF"-FileName<FileModifyDate" "-FileName<DateCreated" "-FileName<CreateDate" -d "/mnt/user/Photography-Archive/exifdata/%Y/%m/%d/%Y-%m-%d-%H-%M-%S-0%%c.%%le" <FileOrDir>In the first example, exiftool makes sure that the files are in alphabetical order based upon filename (
-fileorder Filename). It then takes the data from the associated XMP file to do the renaming. I've removed the
FileModifyDate rename part because it's unlikely that the XMP file will have the same timestamp as the RAW file. Because the only file extension that exiftool will processes that comes after .xmp is .zip, this means that the command will rename all other files with the same filename before it renames the XMP files. Obviously, if you have a XMP file matching a .zip file, it will fail at that point.
In the second example, in order to process the XMP files first before the RAW files, the file order is reversed, indicated by the dash in front of filename (
-fileorder -Filename).
I leave it up to you to test (use
Testname instead of
Filename) to see which is the correct option for you.
QuoteIs there a way to use ExifTool to check for duplicates?
Exiftool has no ability to check for duplicates. There are several free tools out available out on the web. For example, Dupguru (https://dupeguru.voltaicideas.net/) is cross platform and has an option for image searches.
Quotemaybe adding a MD5 Hash as a keyword?
The biggest problem with this is that if there is even one byte difference in the metadata, you have a completely different hash. Additionally, the same picture can have the exact same graphical data, but be binarily different. An example of this is a progressive encoded jpg vs. a standard encoded jpg. Or a PNG with a compression level of 0 (no compression) vs level 9 (best compression).
There are a few posts on this forum about dealing with an MD5 hash.