tagsfromfile and setting the correct selection for looping

Started by u.b.muc, August 07, 2015, 06:49:24 PM

Previous topic - Next topic

u.b.muc

In a given directory tree, I've got:

- several .MOV files as the source files
- for each .MOV a corresponding .JPG that already exists as destination file. Filename is same, just extension differs.
- several additional .JPG files that have nothing to with the above

What I want to do is:
a) Copy tags from each MOV to its corresponding JPG.
b) Ignore all JPG that are not related to a MOV.

What I've tried so far is:

-r
-ext
.JPG
-tagsfromfile
%d%f.MOV
-DateTimeOriginal<ContentCreateDate


This works fine for a)
But it throws an error message for each b). ("Warning: Error opening file"). Which is no surprise, because this JPG does not correlate with a MOV.

Question: Is there any conditional processing that fulfills "process only .JPG where a .MOV of same name exists"? As the JPGs without corresponding MOV by far outnumbers the related ones, just ignoring the error message is not very elegant as there will be hundreds of errors per one expected success.

What I also played around with as alternate option was based on

-ext
.MOV
-o
%d%f.JPG

This correctly comes from processing the list of MOV files and only tries to touch JPG that are related to a MOV. However, seems this in general is not designed to copy tags to a JPG file...?


Phil Harvey

Try this:

-r
-ext
mov
-tagsfromfile
@
-DateTimeOriginal<ContentCreateDate
-srcfile
%d%f.JPG


This uses the advanced (and somewhat confusing) -srcfile option to process files different than those named 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 ($).

u.b.muc

Great, that works as intended. Now I finally understand the -srcfile option - after having read it tens of times in the doc leaving me confused  :-[

Maybe it would make sense to add this specific example in the doc here? I think this could help a lot...

Thanks a lot!
-Uwe




Phil Harvey

Good point.  I'll add an example to the -srcfile documentation.

- 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 ($).