ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: dwlott on January 15, 2024, 11:04:03 PM

Title: How to determine if list-type content is really a list.
Post by: dwlott on January 15, 2024, 11:04:03 PM
Hello again,
-Keywords returns a comma separated list.  How can I tell if it's a list or just one value of comma separated strings?

After posting, I found this:
https://exiftool.org/struct.html

I have some homework to do.
Title: Re: How to determine if list-type content is really a list.
Post by: dwlott on January 15, 2024, 11:24:25 PM
Quote from: dwlott on January 15, 2024, 11:04:03 PM-Keywords returns a comma separated list.  How can I tell if it's a list or just one value of comma separated strings?
This works great.

-struct
-f
-T
-Directory
-FileName
-Keywords
e:\mySourceFolder

Title: Re: How to determine if list-type content is really a list.
Post by: StarGeek on January 15, 2024, 11:33:48 PM
I use the -sep option (https://exiftool.org/exiftool_pod.html#sep-STR--separator). 

C:\>exiftool -G1 -a -s -Subject y:\!temp\Test4.jpg
[XMP-dc]        Subject                         : This, is, a, list, This, is, not, a, list

C:\>exiftool -G1 -a -s -sep ## -Subject y:\!temp\Test4.jpg
[XMP-dc]        Subject                         : This##is##a##list##This, is, not, a, list
Title: Re: How to determine if list-type content is really a list.
Post by: wywh on January 16, 2024, 03:36:45 AM
I use -sep '//' (GraphicConverter uses , and ; as a separator when writing so I use // in exiftool to check what is the actual separator) or -v (the separated list tags should then be on separate lines):

exiftool -a -G1 -s -sep '//' -Keywords -Subject image.jpg
[IPTC]          Keywords                        : Harvey, Phil//Marley, Bob
[XMP-dc]        Subject                         : Harvey, Phil//Marley, Bob

exiftool -a -G1 -s -v image.jpg
  | + [IPTC directory, 85 bytes]
  | | Keywords = Harvey, Phil
  | | Keywords = Marley, Bob
  + [XMP directory, 3105 bytes]
  | Subject = Harvey, Phil
  | Subject = Marley, Bob

BTW I just noticed that macOS 14.2.1 Sonoma Photos.app forces comma as a separator when importing such image or movie Keywords (on the other hand it accepts semicolon in Keywords). I'd avoid both characters in list type tags.

- Matti
Title: Re: How to determine if list-type content is really a list.
Post by: StarGeek on January 16, 2024, 11:33:58 AM
Quote from: wywh on January 16, 2024, 03:36:45 AMBTW I just noticed that macOS 14.2.1 Sonoma Photos.app forces comma as a separator when importing such image or movie Keywords (on the other hand it accepts semicolon in Keywords). I'd avoid both characters in list type tags.

The old Google Picasa software did the same thing. It was really annoying.
Title: Re: How to determine if list-type content is really a list.
Post by: dwlott on January 17, 2024, 04:05:30 PM
Thank you guys for the extra tips.  The information saved me time.