Main Menu

Keyword separator

Started by dennis508, November 29, 2019, 08:29:28 AM

Previous topic - Next topic

dennis508

HI Phil,

Somewhere between 11.00 and 11.77 keyword output added a trailing separator. I couldn't find anything in the revision history but could have missed it.

$exiftool -ver
11.00
$ exiftool -keywords 1.jpg
Keywords                        : a, b, c, d

$exiftool -ver
11.77
$ exiftool -keywords 1.jpg
Keywords                        : a, b, c, d,  <== notice the comma

Was this intentional? Have there been any other recent output format changes?

Thanks

Phil Harvey

There should have been no change in the keyword output formatting.  A trailing "," indicates that there is a blank item at the end of the list.  How did you write these keywords?  Also, maybe you could send me the file (1.jpg) so I can take a look (my email is philharvey66 at gmail.com)

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

Phil Harvey

I got the samples.  Yes there was a difference between those versions when writing keywords.  Older versions didn't allow blank keywords to be written, but newer versions do.

But if you aren't trying to write a blank keyword, then there must be a problem with the command you are using.  What command are you using to write the keywords?

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

dennis508

ProcessBuilder pb = new ProcessBuilder(myExifProgram, "-stay_open", "true", "-@",  "-");

-iptc:codedcharacterset=utf8
-overwrite_original_in_place
-m
-sep
;
-IPTC:Keywords=a; b; c; d;
/C/C/Photos/Problems/1.jpg
-execute

StarGeek

The semicolon after the d in -IPTC:Keywords=a; b; c; d; is what gives you the empty keyword.  Remove the trailing semicolon and you won't get an empty keyword.
"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

dennis508

Thanks, I understand. But I think creating an empty keyword should be a little more explicit than a trailing separator that was never previously rejected.

Phil Harvey

This change was necessary to allow lists to be copied exactly.  There are rare use cases where blank entries in lists are significant, and ExifTool needed to support 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 ($).

dennis508