Command to add a keyword to JPG / CR2

Started by NHGuy78, July 21, 2021, 10:27:43 PM

Previous topic - Next topic

NHGuy78

Hi,

Is it possible to run a command that will:

1) Search of subfolders for JPG and CR2
2) Add (not remove what is there) a keyword?

Thank you in advance and thank you for a great tool!

Edit:
Windows 10, latest Exif build

StarGeek

The basic command would be
exiftool -r -ext jpg -ext cr2 -TAG+="New Keyword" /path/to/files/

First, though, you have to figure which TAG holds the keywords in your case.  The two main keyword tags are IPTC:Keywords and XMP:Subject, so you can check with your other programs to see which tag is being read.

Also, exiftool doesn't check for duplicates, so you have to do the work yourself.  See FAQ #17, paragraph starting "To prevent duplication...", though that whole FAQ section is important to read as well.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

NHGuy78

Thank you for the reply,  got this:
QuoteWarning: Tag 'TAG' is not defined
Nothing to do.
Command: exiftool -r -ext jpg -TAG+="New Keyword" /Test/Misc
I also tried:
exiftool -r -ext jpg -KEYWORDS+="New Keyword" /Test/Misc
Error: File not found - /Test/Misc

I think this may be a little over my head- I can do basic command line and programing but I am used to Geosetter.de. It works great but locks up with more than 2,000 files.

StarGeek

Quote from: NHGuy78 on July 22, 2021, 10:50:18 AM
Command: exiftool -r -ext jpg -TAG+="New Keyword" /Test/Misc

You have to replace TAG with that actual tag you want to write to.  My suggestions were IPTC:Keywords and/or XMP:Subject.  You can set both in the same command, just duplicate the example.  Since I have no idea what program you will be using to see the keywords, I can't advise you further than that.

QuoteI also tried:
exiftool -r -ext jpg -KEYWORDS+="New Keyword" /Test/Misc
Error: File not found - /Test/Misc

You have to put a path to the files here.  If you put /Test/Misc, exiftool will be looking for these directories below the current directory.  CMD, for example, starts with the current directory as C:\Windows\System32 and your files are almost certainly not in C:\Windows\System32\Test\Misc

QuoteI think this may be a little over my head- I can do basic command line and programing but I am used to Geosetter.de. It works great but locks up with more than 2,000 files.

Geosetter has the ability to set the keywords for you.  Select your images, select the "Edit location and other data..." button


Select the "Categories/Keywords" tab


Add you keywords and the hit "Ok".

If you're having problems with too many images, try separating them into smaller batches first.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

NHGuy78

I love Geosetter- great application but it seems to have been dropped by the developer. I have 18,000 files I need to change so I'll have to work out a way of breaking them down.

Thank you,

StarGeek

You could try Adobe Bridge, which is free.  It should be able to set full directories at once.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype