ExifTool Forum

ExifTool => Newbies => Topic started by: frereroy on July 06, 2018, 01:42:08 PM

Title: Tag files from one directory if they occur in another
Post by: frereroy on July 06, 2018, 01:42:08 PM
I have a directory that contains a list of 30 files that have been published on the web in low resolution. I have another directory of the full size images + many other "second choice" candidates.

I would like to add the XMP-xmp "Rating: 5" to all the files in the full size image directory only if they occur in the low resolution directory.

Am sure that Exiftool could sort this out but do not really know where to start.

TIA for any help and enlightenment.
Title: Re: Tag files from one directory if they occur in another
Post by: Stephen Marsh on July 09, 2018, 04:38:43 AM
Are the filenames exactly the same or similar with a consistent naming pattern between the LR and HR images?

Is there a unique piece of metadata that matches between the LR and HR images?
Title: Re: Tag files from one directory if they occur in another
Post by: Phil Harvey on July 09, 2018, 07:24:29 AM
You could do something like this if the file names are identical:

exiftool -if '-e "LOWRESDIR/$filename"' -xmp-xmp:rating=5 DIR

The above quoting is for Mac/Linux.  For Windows:

exiftool -if "-e qq(LOWRESDIR/$filename)" -xmp-xmp:rating=5 DIR

- Phil
Title: Re: Tag files from one directory if they occur in another
Post by: frereroy on July 20, 2018, 10:09:10 AM
Works great - many thanks.
Am wondering if there is any action that Exifttol CANNOT perform  ;)
Title: Re: Tag files from one directory if they occur in another
Post by: Phil Harvey on July 20, 2018, 10:12:10 AM
I'm still having trouble getting it to wash the dishes for me.  :-\

- Phil
Title: Re: Tag files from one directory if they occur in another
Post by: StarGeek on July 20, 2018, 10:50:17 AM
And the dirt is just caked on my Windows.