Using ExifTool for Bulk Operations

0

I would like to have help please with ExifTool, for the following operations:

  1. I have thousands of pictures scattered across dozens of sub-folders. All sub-folders are nested under a single parent folder, though. How do I tell ExifTool to apply the changes on all files?

  2. What I would like to do specifically is to "cut" each value under the "Copyright" EXIF tag, and "paste" it to the "UserComment" EXIF tag. I would like to this for all photos at once, and each photo has to keep its respective value (only now under a different tag), of course. Again, not all photos have a value in the "Copyright" field, I assume those will be ignored by the software.

  3. Finally, I would ExifTool to erase every possible metadata but the newly created values under the "Comments" tag.

Help and guidelines will be greatly appreciated.

Thanks!

voronoi

Posted 2017-09-29T04:17:44.447

Reputation: 541

Answers

1

Try this command:
exiftool -r -all:all= -tagsfromfile @ "-UserComment<Copyright" <DIR>

-r is the option to recurse into subdirectories
-all:all= will remove all metadata
-TagsFromFile @ copies tags listed after this option from the current file back into the file "-UserComment<Copyright" After the TagsFromFile, it will copy the Copyright but redirect it into the UserComment tag.

Make sure and test it first of course. This command will leave backup files with _original added to the extension. You can prevent this once you make sure that the command is correct by adding -overwrite_original.

StarGeek

Posted 2017-09-29T04:17:44.447

Reputation: 782

Thanks @StarGeek! A few questions though: 1. Writing -all:al= before -tagsfromfile will not result first in loss of all metadata? (then ExifTool will not have any tags to copy). 2. I guess <DIR> is where I insert the parent folder's full directory? – voronoi – 2017-10-04T02:46:39.407

1It will still have all the data available as it figures out how to process the commands. It doesn't instantly toss all data when it gets the -all:all= option. It just doesn't write out all the data when it rewrites the file. Yes, <DIR> is the path to your target directory, whether it's the full path, a relative path, or just a dot . for the current directory. – StarGeek – 2017-10-04T08:04:35.007

Thanks a lot @StarGeek, you command worked out beautifully (I changed the <> marks around DIR to quotation marks). At the end of the process, ExifTool said that:

17 image files unchanged 1 files weren't updated due to errors

How can I check which files exactly were left unchanged or weren't updated (and due to what error exactly)?

Thanks! – voronoi – 2017-12-08T21:05:49.180

The file that had the error should have had an explanation in the output. Unchanged files would be files that either already had the all data stripped and no change to UserComment, or didn't have any data to strip and don't take EXIF metadata, like a BMAP file. Try redirecting the output into a file if there's more than you can read in the command line. Add -progress or -v2 to get more extensive information. – StarGeek – 2017-12-08T21:23:39.327

Hi @StarGeek, I added the two commands you suggested. I still couldn't figure out what files were not processed, in either case. In both cases I copied the entire output to Notepad++

  1. Adding -progress after -r doesn't seem to make much of a difference in terms of output compared to your initial command.
  2. -v2 after -r results in thousands of additional text lines, and without knowing specifically what to type in the search field, there's no way to find what I'm looking for.

Is there a sure way to find what were the problematic files? Is there a recurring syntax in case of errors? – voronoi – 2017-12-16T19:08:53.767

With the -v2 output, you should find the line Nothing changed in and then the name of the file that wasn't changed. The file that wasn't updated due to an error should have some sort of error or warning text even without the -v2 option. I think that it will even use the words error or warning. – StarGeek – 2017-12-17T08:16:04.910

Further clarification, files that have errors will print a line that starts with Warning: or Error:. I think this is printed to stderr. Files with no change will not be listed normally, but with the addition of the -v2 or -progress options, exiftool will print a line that reads Nothing changed in <name of file>. – StarGeek – 2017-12-18T19:53:44.103

Thanks a lot for the input! Searching for warning after running the command with -v2, results in 27 matches (error and stderr does not yield any useful results). This does not settle with the overall 14 "problem" files (13 unchanged, 1 wasn't updated due to an error). Weirdly enough, checking the very files that had the warning the next to them shows that they were updated as expected. – voronoi – 2017-12-21T21:03:57.057