Strange effects when writing keywords

Started by lokatz, May 27, 2022, 12:15:33 PM

Previous topic - Next topic

lokatz

Have been using ExifTool now for quite a while in my (large) software project, but I'm still merely a novice user rather than an expert. After I mostly used it for reading metadata, previews, etc.,  I am currently implementing a routine to modify and write back keywords.  This is where I see two rather strange effects, though I THINK I am doing what the documentation, in particular FAQ #17, tells me to do.

An arbitrary example, straight from the args.txt file:

[filename]
-overwrite_original
-sep
", "
-IPTC:Keywords="Unsaturated, Architecture, Building, Tower, Window, Wall, House, Ruin, ABC"
-IPTCDigest=new
-XMP-dc:Subject="Unsaturated, Architecture, Building, Tower, Window, Wall, House, Ruin, ABC"
-XMP-lr:HierarchicalSubject="Architecture, Architecture|Ruin, Architecture|Ruin|ABC"
-execute


What happens are two things:  ExifTool gives me a "Warning: [Minor] IPTC:Keywords exceeds length limit (truncated)", plus the image file receives these keywords WITH the surrounding quotation marks, which looks as if the -sep command has been ignored. This is with ExifTool 12.40 on a Windows system. 

Any idea what may be causing this?

Phil Harvey

Quotation marks are not used around arguments in a -@ argfile (see the -@ option documentation).  The quotation marks are only part of the command shell syntax, and not handled by ExifTool.

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

lokatz

#2
I sensed there was something I was overlooking.  Thank a lot, Phil!

EDIT:  Even after dropping the quotation marks, I still get the "exceeds length limit (truncated)" warning with the same example as above.  Checking several example images, it appears to happen whenever the total chain of keywords is more than about 60 characters (or more than ~7-8 entries?) long.  Is there an IPTC limit of some kind that I may be unaware of?

Phil Harvey

There is a limit on the individual keywords, so if you are hitting the limit then your keywords aren't being split properly.  Did you also remove the quotes from the -sep argument?

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

lokatz

Well, I guess you already knew the answer.   :-\    I did NOW, and that fixes it.  Thanks!  (Only excuse:  I'm not exactly at home in a command line environment...)

StarGeek

"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