Remove All Metadata except certain tags - How to do it?

Started by florin22xxl, October 19, 2020, 08:26:32 AM

Previous topic - Next topic

florin22xxl

Hi guys,
Amazing piece of software here!
I am trying to remove all metadata informatiom from some xmp files excep certain pieces of information.
How do i go about doing that?
If i use -all= it deletes everything
Do i need to use tagsFromFile option?
I have attached a photo showing in red everything that i don't want deleted.
Any help is apreciated!
https://imgur.com/a/xuCTaBb


Phil Harvey

You have the right idea.  You can exclude an entire group from a mass delete with --GROUP:all, but individual tags must be added back with -tagsfromfile.  See the last 2 sentences of the application documentation for --TAG:

       --TAG
            Exclude specified tag from extracted information.  Same as the -x
            option.  Group names and wildcards are permitted as described
            above for -TAG.  Once excluded from the output, a tag may not be
            re-included by a subsequent option.  May also be used following a
            -tagsFromFile option to exclude tags from being copied (when
            redirecting to another tag, it is the source tag that should be
            excluded), or to exclude groups from being deleted when deleting
            all information (eg. "-all= --exif:all" deletes all but EXIF
            information).  But note that this will not exclude individual tags
            from a group delete (unless a family 2 group is specified, see
            note 4 below).  Instead, individual tags may be recovered using
            the -tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").


Add any tags you want to preserve in place of -artist in the last example above.  Include group names if you want them to stay in the same group (ie. -tagsfromfile @ -all:artist -all:usercomment)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

florin22xxl

#2
Thanks for the reply!
What if i want to only delete those 3 tags and keep everything else?
Assuming i dont need to use -all= command.
Is this the best way to do it?
exiftool -overwrite_original -tagsFromFile @ -RGBTable "D:\New folder"
I tried using:
exifool -TAG="NAME" "D:\New folder"
and i got Warning: Tag 'TAG' is not defined
Nothing to do.
:o

Phil Harvey

To delete individual tags:

exiftool -TAG1= -TAG2= -TAG3= ... FILE

- Phil

Edit: Oh.  The "not defined" warning means that it isn't a standard tag.  You would need to add a definition for a user-defined tag in a config file to be able to delete these.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

florin22xxl

Thank you for the reply.
Is there any documentation on how to write these tag definitions?

Phil Harvey

Do you mean what tag names you should use in place of TAG1, etc?  See FAQ 2 for this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).