ExifTool Forum

ExifTool => Newbies => Topic started by: AlanX on January 22, 2023, 12:34:11 PM

Title: Removing all metadata except title author copyright and contact
Post by: AlanX on January 22, 2023, 12:34:11 PM
Sorry, this is probably a pretty basic question that's been answered before.
I want to remove all metadata except title, author, copyright, copyright status and contact details, and write the files to a new folder. I want to process all images in all subfolders of the specified folder, and retain that file structure in/under the output folder.
I'm sure someone can save me oodles of time working out how to do this. Grateful for any pointers. Thanks.
Title: Re: Removing all metadata except title author copyright and contact
Post by: StarGeek on January 23, 2023, 11:25:39 AM
Your basic command would be
exiftool -all= -TagsFromFile @ -TAG1 -TAG2 -TAG# /path/to/files/

Replace TAG1,TAG2, TAG#, etc with the names of the tags that you want to keep.

The data you want to keep could be stored in multiple locations, so you'll have to use the command in FAQ #3 (https://exiftool.org/faq.html#Q3) to figure out the actual names of the tags you want to keep.

Title: Re: Removing all metadata except title author copyright and contact
Post by: AlanX on January 23, 2023, 12:20:52 PM
Many thanks, StarGeek. So much to read, so little time!! Really appreciate your help.
I take your point about multiple locations for some data. But the most important thing for me is removing the camera data and 'personalised' fields like Description, Keywords, etc, for which your script works fine, and I can always adjust to taste now I've got the hang of it.
I think I can forego the luxury of sending the new files to a different folder (so not renaming the _originals), and also the luxury of processing all sub-folders in one hit. So I have a working solution. Thanks again.
Title: Re: Removing all metadata except title author copyright and contact
Post by: AlanX on January 24, 2023, 05:04:40 AM
Thought I'd try the recursive option, but can't get it to work. I have a parent folder with all of my images in 30 sub-folders.

I've tried
C:\exiftool -r -all= -TagsFromFile @ -Creator -Copyright "D:\images-top-folder\*.jpg"
and
C:\exiftool -r -all= -TagsFromFile @ -Creator -Copyright "D:\images-top-folder\*\*.jpg"

I've tried this as a .bat and in the command line. What am I doing wrong?
Title: Re: Removing all metadata except title author copyright and contact
Post by: StarGeek on January 24, 2023, 04:04:26 PM
This is Common Mistake #2c (https://exiftool.org/mistakes.html#M2).  From the docs on the -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse)
   Only meaningful if FILE is a directory name

You want to pass it just the directory name, no wildcards, and use the -ext (-extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension) to limit processing to just jpgs.
Title: Re: Removing all metadata except title author copyright and contact
Post by: AlanX on January 24, 2023, 05:45:40 PM
Got it! A thousand thanks - you're a star, geek! :)  :)