News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Updating or moving depending on Author Tag

Started by schlemiel29, November 01, 2015, 10:30:05 AM

Previous topic - Next topic

schlemiel29

Hi,
I had already managed to update an image by an increment, like

exiftool "-AllDates-=0:0:0 6:00:0" -r overwrite_original DIR

But now I only want to do this, when author tag is "me". So I need the "-if" parameter. But what else? A "$EXIF:" in front? I'm using OSX, so do I have to put >me< in single quotes like 'me'?

Maybe I split this task in two pieces? First move all matching files to a folder DIRSUB and then I could use my already tested statement above?
How would the command for moving files with if-clause look like?

Thanks in advance
Dirk

StarGeek

Try something like:
exiftool -if '$Author eq "me"'  '-AllDates-=0:0:0 6:00:0' -r overwrite_original DIR

Quote from: schlemiel29 on November 01, 2015, 10:30:05 AM
A "$EXIF:" in front?
You would do this only if you wanted to specify a tag in the EXIF block.  But since the EXIF block doesn't have an Author tag, it wouldn't do anything.  In most cases, just "Author" should be enough.  Unless you mean XPAuthor, which is in the EXIF block.

I'm not sure of the exact quoting you would need to use on a Mac, but normally you would use single quotes to enclose the full option (if needed).
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

schlemiel29

The program reports that all files failed the condition. When simply showing EXIF data, the name is shown after the description "Artist". But when changing "Author" to "Artist" the result is the same. All files skiped.  :-\

Phil Harvey

Is Artist exactly equal to "me"?  Perhaps there are some extra spaces or something.  What does this output?:

exiftool -p '"$artist"' -r DIR

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

schlemiel29

Hi Phil,
I think I come closer and closer. Now

/usr/bin/exiftool -if '"$Artist" eq "Peter Meier-de Haan"' -r '/Volumes/MacOS/fasttemp/T'

is showing the content of the selected few files from some hundreds That's fine so far. Next I only want to update them by adding 2 hours to the dates:

/usr/bin/exiftool -if '"$Artist" eq "Peter Meier-de Haan"' '-AllDates+=0:0:0 2:00:0' -r '/Volumes/MacOS/fasttemp/T'

But here the app keeps silent without any output and the date/time picture takes remains untouched.
Is there a mode, were I can see what the app is doing or thinking what it should to?
Best regrads
Dirk

Phil Harvey

Hi Dirk,

Your command looks good, although there are some extra quotes that aren't necessary, and your time shift value may be simplified:

/usr/bin/exiftool -if '$Artist eq "Peter Meier-de Haan"' '-AllDates+=2' -r '/Volumes/MacOS/fasttemp/T'

This command should return a message about the number of image files updated.  There are 2 reasons why this says 0 while the other command processed some images:

1) The images from the first command were not in a writable format

or

2) There were no writable date/time values in the metadata

Change your first command to this to see the date/time tags available, and make sure they are writable.  Note that "System" tags are not written by default since they are considered "unsafe".

/usr/bin/exiftool -if '$Artist eq "Peter Meier-de Haan"' -r -time:all -a -G1 '/Volumes/MacOS/fasttemp/T'

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

schlemiel29

Now it seems to work. Thank you very much.
It seems I had problems using Terminal app when using copy & paste commands from Editor. When entering everything by keyboard, it works fine.  :D

Phil Harvey

Cut-n-paste is a problem from this forum on OS X because there whenever there are two spaces in a row the forum inserts a non-breaking space, but that doesn't work 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 ($).