ExifTool Forum

ExifTool => Developers => Topic started by: dennis508 on November 29, 2019, 08:29:28 AM

Title: Keyword separator
Post by: dennis508 on November 29, 2019, 08:29:28 AM
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
Title: Re: Keyword separator
Post by: Phil Harvey on November 29, 2019, 09:07:55 AM
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
Title: Re: Keyword separator
Post by: Phil Harvey on November 29, 2019, 10:47:09 AM
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
Title: Re: Keyword separator
Post by: dennis508 on November 29, 2019, 03:43:52 PM
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
Title: Re: Keyword separator
Post by: StarGeek on November 29, 2019, 08:22:26 PM
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.
Title: Re: Keyword separator
Post by: dennis508 on November 30, 2019, 07:02:04 AM
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.
Title: Re: Keyword separator
Post by: Phil Harvey on November 30, 2019, 08:05:15 AM
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
Title: Re: Keyword separator
Post by: dennis508 on November 30, 2019, 08:43:09 AM
OK, thanks for your help.