Writing tags to be null values

Started by ericconn, October 20, 2022, 09:46:52 AM

Previous topic - Next topic

ericconn

Apologies if I'm not reading the documentation correctly, but I'm trying to erase fields, including Keywords, Description, Title and Event. Using -(tag)="" didn't work, neither did -(tag)=. Am I missing a character? Thanks so much.

Phil Harvey

Your syntax is correct to delete a tag:

> exiftool a.jpg -keywords
Keywords                        : test
> exiftool a.jpg -keywords=
    1 image files updated
> exiftool a.jpg -keywords
>

If you really want to write a null value, use "^=":

> exiftool a.jpg -keywords^=
    1 image files updated
> exiftool a.jpg -keywords
Keywords                        :
>

I'm not sure, but the caret (^) may need quoting in Windows.

- 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 ($).

StarGeek

Quote from: Phil Harvey on October 20, 2022, 11:25:20 AMI'm not sure, but the caret (^) may need quoting in Windows.

You are correct.  The caret ^ is an escape character and needs quoting under Windows CMD but does not need quoting under PowerShell.
"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

ericconn

Ok thanks, I figured out the correct syntax but revealed another issue.

C:\Test\Keywords>exiftool -Keywords -Subject -Title -ObjectName -Description -ImageDescription -Caption-Abstract -Event "C:\Test\Keywords\Test.jpg"
Keywords                        : Keywords
Subject                         : Keywords
Title                           : Title
Object Name                     : Title
Description                     : Description
Image Description               : Description
Caption-Abstract                : Description
Event                           : Event

C:\Test\Keywords>pause
Press any key to continue . . .

C:\Test\Keywords>exiftool -Keywords=^"" -Title=^"" -Description=^"" -Event=^"" "C:\Test\Keywords\Test.jpg"
    1 image files updated

C:\Test\Keywords>exiftool -Keywords -Subject -Title -ObjectName -Description -ImageDescription -Caption-Abstract -Event "C:\Test\Keywords\Test.jpg"
Subject                         : Keywords
Object Name                     : Title
Image Description               : Description
Caption-Abstract                : Description


The issue was that, for instance, it was deleting the Keywords field but not Subject, so when looking in Adobe Bridge, I was still seeing the previous Keywords field and Exiftool was telling me it Keywords=null, which was very confusing. Bridge was pulling from the Subject field. When adding/rewriting the Keywords field in the past, it seemed the change would be reflected in the Subject field as well. So for the all the tags I want to clear out, I have to also include the above.

Is this normal to have to change the different iterations (sorry, correct term is evading me) of the same tag when using this command vs. adding/re-writing or am I missing something again about how Exiftool behaves? Thanks so much.

Phil Harvey

This is (unfortunately) absolutely normal.  The metadata landscape is a bit of a mess.  Before XMP, IPTC:Keywords was the only place to store this.  But then XMP introduced XMP:Subject which stored the same information.  Applications sometimes use one or other or both.  In general, Adobe prefers XMP.

There is an MWG specification which attempts to standardize some of this, and does specifically address the Keywords/Subject problem.  (See the ExifTool MWG tags.)  To take advantage of this you could write the ExifTool MWG:Keywords tag.

- 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 ($).

ericconn

Thanks, I misspoke when I thought it rewrote across tags. Bridge just seems to pull from whatever field it wants to, not showing what's still hidden in the metadata.

Either way my problem is solved, I just need to more add more tags to the command. Thanks again.

StarGeek

You might try the MWG tags.  Setting those will set multiple tags as shown on that page.  I'm pretty sure Bridge follows the MWG standard when reading and writing data.

So you could use
exiftool -MWG:Description^= -MWG:Keywords^= /path/to/files/

And that will set all of these tags
EXIF:ImageDescription
IPTC:Caption-Abstract
XMP-dc:Description
IPTC:Keywords
XMP-dc:Subject


You will still have to set IPTC:ObjectName and XMP:Title separately.

You might also try using the command in FAQ #3 so you can see the actual tag names (not tag descriptions), duplicate tags, and the groups they belong to.
"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