Workflow suggestions (and likely -args assistance)

Started by Mr. Moon, September 19, 2011, 05:15:03 AM

Previous topic - Next topic

Mr. Moon

Hello all.  First and foremost, thank you for this wonderful tool, which has allowed me to begin restoring my photo library after a catastrophic HDD failure.  I was able to salvage almost all my files, but now I am left with the task of sorting thru nearly 1TB of edited and original pics. The goal is simply to sort the edited photos from the originals, and keep the originals, which was complicated by the fact that the recovery process caused the filenames to be lost.

To achieve the goal of keeping only the originals, my workflow has been as follows:
1.  Removal of corrupt files, e.g. anything completely missing tags. (I've done this for the entire collection now)

2.  Determine whether files were previously edited based on: -if 'not $FileNumber', or  -if '$HostComputer le "Mac*"', or the presence of an icc_profile. I found many files that appeared identical but had different tags, so I piped the output to a couple text files and used vimdiff to determine the differences.  This shows me which files have been edited at some point, and these photos are renamed with a 'modified' prefix and moved elsewhere for deletion (or restoration, in the event the original cannot be found).

3. I use another utility called fdupes to find and delete files with matching md5 values.  This leaves me a directory of what seem to be original files.  I then rename them using exiftool -m -r -if '$Model eq "Canon EOS 7D"' '-filename>$Model_${FileNumber}%-c.%le' . to keep photos from different Canon cameras I've owned in proper order.

4. These files are then moved into a "master" directory of originals.

I worked through the steps above simply to ensure that I was achieving what I set out to do, but now I am confused about how (or whether) to implement the above steps in an ARGFILE.  I've read many of the examples on the forum, as well as some other blogs, but for some reason I can't wrap my head around how to generate or structure the ARGFILE. Having read the performance benchmarks when using an argfile, I can't help wondering if there's a more efficient way to approach my dilemma.

Thanks for any suggestions about how to proceed. 

-Jay

Phil Harvey

Hi Jay,

The argfile performance benefit is only really used to allow a calling application to keep exiftool open to avoid the overhead of launching it for each file.

You can achieve the same performance benefit without an argfile by batch processing multiple files with the same command.  Since it looks like you are already doing this, you wouldn't see any additional performance benefit from keeping exiftool open through the use of an argfile.

In your case, however, an argfile may allow you to save some typing.  The argfile syntax is very simple:  It uses a newline as a delimiter between arguments.  That's it.  No quotes are used as with arguments on the command line.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mr. Moon

#2
Thanks Phil.  That clarifies matters a lot for me, so now I can proceed.  I figured that, at the very least, it would do just as you said and minimize the amount of typing I'm doing (which is already admittedly minimal).

The part I'm fuzzy on is how the ARGFILE is created and when the -execute tag comes into play. I understand that my ARGFILE might look something like this:


-if
$Model eq Canon EOS 7D
-icc_profile=
-filename<$Model_${FileNumber}%-c.%le


Do I just execute exiftool -@ ARGFILE DIR? For some reason I thought I needed to generate an output ARGFILE...

Thanks again.

Phil Harvey

This looks good.  The -execute option is only used if you want to execute multiple commands in a single argfile.

There are various ways to create your argfile, but it sounds like using a simple plaintext editor is what you want.  Just create the file using your favourite word processor and save it as plain ASCII text.  (As I have done with the attached file.  So your command would be exiftool -@ test.args DIR)

- Phil

Edit: Ooops.  I just noticed the ">" in your last argument should be a "<".  I fixed this in the "test.args" file.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mr. Moon

hehe thanks.  I noticed it as well and made the edit, apparently right as you did.