ExifTool Forum

ExifTool => Newbies => Topic started by: schlemiel29 on November 01, 2015, 10:30:05 AM

Title: Updating or moving depending on Author Tag
Post by: schlemiel29 on November 01, 2015, 10:30:05 AM
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
Title: Re: Updating or moving depending on Author Tag
Post by: StarGeek on November 01, 2015, 01:40:55 PM
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).
Title: Re: Updating or moving depending on Author Tag
Post by: schlemiel29 on November 02, 2015, 06:04:13 AM
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.  :-\
Title: Re: Updating or moving depending on Author Tag
Post by: Phil Harvey on November 02, 2015, 08:14:02 AM
Is Artist exactly equal to "me"?  Perhaps there are some extra spaces or something.  What does this output?:

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

- Phil
Title: Re: Updating or moving depending on Author Tag
Post by: schlemiel29 on November 03, 2015, 02:55:07 AM
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
Title: Re: Updating or moving depending on Author Tag
Post by: Phil Harvey on November 03, 2015, 07:42:22 AM
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
Title: Re: Updating or moving depending on Author Tag
Post by: schlemiel29 on November 03, 2015, 11:40:18 AM
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
Title: Re: Updating or moving depending on Author Tag
Post by: Phil Harvey on November 04, 2015, 08:57:43 AM
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