Author Topic: Updating or moving depending on Author Tag  (Read 1956 times)

schlemiel29

  • Jr. Member
  • **
  • Posts: 11
Updating or moving depending on Author Tag
« 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

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3793
Re: Updating or moving depending on Author Tag
« Reply #1 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

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).
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

schlemiel29

  • Jr. Member
  • **
  • Posts: 11
Re: Updating or moving depending on Author Tag
« Reply #2 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.  :-\

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16703
    • ExifTool Home Page
Re: Updating or moving depending on Author Tag
« Reply #3 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

schlemiel29

  • Jr. Member
  • **
  • Posts: 11
Re: Updating or moving depending on Author Tag
« Reply #4 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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16703
    • ExifTool Home Page
Re: Updating or moving depending on Author Tag
« Reply #5 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

schlemiel29

  • Jr. Member
  • **
  • Posts: 11
Re: Updating or moving depending on Author Tag
« Reply #6 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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16703
    • ExifTool Home Page
Re: Updating or moving depending on Author Tag
« Reply #7 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).