Main Menu

Multiple Keywords

Started by BrianStu, March 26, 2018, 07:26:31 AM

Previous topic - Next topic

BrianStu

Hi I have (or rather had!) some jpeg files with multiple Keywords added (as Tags in Shotwell) such that if a photo contained 3 people then the names were added as Keywords (eg Tom, Dick, Harry). This enabled me to search for all photos for example with Tom in (with Shotwell).

Recently i edited some of the photos with Gimp 2.9.9 and that changed the Keyword info, such that the names can no longer be searched in Shotwell.

Originally the data was stored under both "XMP Subject" and "IPTC Keywords" as a comma separated list of the 3 names (from Shotwell).

The new data seems to have a comma separated list in "XMP Subject" and just the first name in "IPTC Keywords".
I tried using "exiftool '-Keywords<Subject' file.jpg to copy the list across, this seemed to work as far as exiftool shows but Shotwell is still not right.

The problem seems to be that the names were originally as a list of names separated by commas, wheras now they seem to be a single string of names separated by commas. Exiftool doesn't seem to show the difference it just shows a list of comma delimited values.

I used exiv2 which showed the difference and shows the Keywords as 3 separate values.

Is there a way I can copy this data across from Subject to Keywords and retain the individual names rather than a string of the 3.

I can provide a sample of an image before and after if required

Phil Harvey

There is no IPTC tag named "Title".  Do you mean XMP-dc:Title, or IPTC:By-lineTitle?  The latter is a list-type tag while the former is not.

Reading FAQ 17 may you to understand the subtleties of list-type tags.

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

BrianStu

Where I originally said Title I meant Keywords.   I have updated the original post to read Keywords instead of Title.

Following your suggestion I looked at FAQ17 and the following seems to suggest a soloution
List items are assigned separately as above, NOT all together, because this would represent a single keyword:

exiftool -keywords="one, two, three" test.jpg  (WRONG!)

With exiftool version 7.56 or later, the -sep option may be used to split values of list-type tags into separate items when writing. For example,

exiftool -sep ", " -keywords="one, two, three" DIR


I tried exiftool -sep ", " '-Keywords<Subject' file.jpg and that fixed the faulty Keyword bit but there is still a problem with the Subject bit.
I then tried exiftool -sep ", " '-Subject<Subject' file.jpg and that seemed to fix it

to do both in 1 command I tried:-
exiftool -sep ", " '-Keywords<Subject' '-Subject<Subject' file.jpg

That seemed to fix my problem.




Phil Harvey

Great.

Yes, it sounds like your Subject was written as a single string instead of separate items.  Your command fixes 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 ($).